[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220316235211.29370-9-lukasz.luba@arm.com>
Date: Wed, 16 Mar 2022 23:52:11 +0000
From: Lukasz Luba <lukasz.luba@....com>
To: linux-kernel@...r.kernel.org
Cc: lukasz.luba@....com, dietmar.eggemann@....com,
Pierre.Gondois@....com, ionela.voinescu@....com,
viresh.kumar@...aro.org, rafael@...nel.org,
daniel.lezcano@...aro.org, linux-pm@...r.kernel.org,
mka@...omium.org, nm@...com, sboyd@...nel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, cristian.marussi@....com,
sudeep.holla@....com, matthias.bgg@...il.com
Subject: [[PATCH 8/8] 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@....com>
---
drivers/powercap/dtpm_cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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);
--
2.17.1
Powered by blists - more mailing lists