[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190130170506.20450-5-quentin.perret@arm.com>
Date: Wed, 30 Jan 2019 17:05:05 +0000
From: Quentin Perret <quentin.perret@....com>
To: viresh.kumar@...aro.org, sudeep.holla@....com, rjw@...ysocki.net,
nm@...com, sboyd@...nel.org, mka@...omium.org
Cc: linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, dietmar.eggemann@....com,
quentin.perret@....com
Subject: [PATCH v2 4/5] cpufreq: arm_big_little: Register an Energy Model
From: Dietmar Eggemann <dietmar.eggemann@....com>
Now that PM_OPP provides a helper function to estimate the power
consumed by CPUs, make sure to try and register an Energy Model (EM)
from the arm_big_little CPUFreq driver, hence ensuring interested
subsystems (the task scheduler, for example) can make use of that
information when available.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@....com>
Signed-off-by: Quentin Perret <quentin.perret@....com>
---
drivers/cpufreq/arm_big_little.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index cf62a1f64dd7..18b05bcb2614 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -487,6 +487,14 @@ static int bL_cpufreq_init(struct cpufreq_policy *policy)
policy->cpuinfo.transition_latency =
arm_bL_ops->get_transition_latency(cpu_dev);
+ ret = dev_pm_opp_get_opp_count(cpu_dev);
+ if (ret <= 0) {
+ dev_dbg(cpu_dev, "OPP table is not ready, deferring probe\n");
+ return -EPROBE_DEFER;
+ }
+
+ dev_pm_opp_of_register_em(policy->cpus, ret);
+
if (is_bL_switching_enabled())
per_cpu(cpu_last_req_freq, policy->cpu) = clk_get_cpu_rate(policy->cpu);
--
2.20.1
Powered by blists - more mailing lists