aboutsummaryrefslogtreecommitdiff
path: root/drivers/powercap/dtpm_cpu.c
diff options
context:
space:
mode:
authorLukasz Luba2022-03-21 09:57:29 +0000
committerRafael J. Wysocki2022-04-13 16:26:18 +0200
commit985a67709a66c456414182ed179544786e00321e (patch)
tree4ce839aa5b083443ae7d762b1ac9c6b6c347f481 /drivers/powercap/dtpm_cpu.c
parent9926bbec3ae6c10d4e6fc297afde6a7ef7ad640b (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 <lukasz.luba@arm.com> Reviewed-by: Ionela Voinescu <ionela.voinescu@arm.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/powercap/dtpm_cpu.c')
-rw-r--r--drivers/powercap/dtpm_cpu.c2
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);