summaryrefslogtreecommitdiffstats
path: root/drivers/powercap
diff options
context:
space:
mode:
authorLukasz Luba <lukasz.luba@arm.com>2022-03-21 09:57:29 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-04-13 16:26:18 +0200
commit985a67709a66c456414182ed179544786e00321e (patch)
tree4ce839aa5b083443ae7d762b1ac9c6b6c347f481 /drivers/powercap
parent9926bbec3ae6c10d4e6fc297afde6a7ef7ad640b (diff)
downloadlinux-stable-985a67709a66c456414182ed179544786e00321e.tar.gz
linux-stable-985a67709a66c456414182ed179544786e00321e.tar.bz2
linux-stable-985a67709a66c456414182ed179544786e00321e.zip
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')
-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);