diff options
| author | Lukasz Luba <[email protected]> | 2022-03-21 09:57:29 +0000 |
|---|---|---|
| committer | Rafael J. Wysocki <[email protected]> | 2022-04-13 16:26:18 +0200 |
| commit | 985a67709a66c456414182ed179544786e00321e (patch) | |
| tree | 4ce839aa5b083443ae7d762b1ac9c6b6c347f481 | |
| parent | 9926bbec3ae6c10d4e6fc297afde6a7ef7ad640b (diff) | |
powercap: DTPM: Check for Energy Model type
The Energy Model power values might be artificial. In such case
it's safe to bail out during the registration, since the PowerCap
framework supports only micro-Watts.
Signed-off-by: Lukasz Luba <[email protected]>
Reviewed-by: Ionela Voinescu <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
| -rw-r--r-- | drivers/powercap/dtpm_cpu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c index bca2f912d349..f5eced0842b3 100644 --- a/drivers/powercap/dtpm_cpu.c +++ b/drivers/powercap/dtpm_cpu.c @@ -211,7 +211,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent) return 0; pd = em_cpu_get(cpu); - if (!pd) + if (!pd || em_is_artificial(pd)) return -EINVAL; dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL); |