lkml.org 
[lkml]   [2019]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/7] cpufreq: scpi: Register an Energy Model
On 28-01-19, 16:55, Quentin Perret wrote:
> 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 scpi-cpufreq, hence ensuring interested subsystems (the task
> scheduler, for example) can make use of that information when available.
>
> Signed-off-by: Quentin Perret <quentin.perret@arm.com>
> ---
> drivers/cpufreq/scpi-cpufreq.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c
> index 87a98ec77773..05fc7448f5cb 100644
> --- a/drivers/cpufreq/scpi-cpufreq.c
> +++ b/drivers/cpufreq/scpi-cpufreq.c
> @@ -23,6 +23,7 @@
> #include <linux/cpufreq.h>
> #include <linux/cpumask.h>
> #include <linux/cpu_cooling.h>
> +#include <linux/energy_model.h>
> #include <linux/export.h>
> #include <linux/module.h>
> #include <linux/of_platform.h>
> @@ -98,11 +99,12 @@ scpi_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)
>
> static int scpi_cpufreq_init(struct cpufreq_policy *policy)
> {
> - int ret;
> + int ret, nr_opp;
> unsigned int latency;
> struct device *cpu_dev;
> struct scpi_data *priv;
> struct cpufreq_frequency_table *freq_table;
> + struct em_data_callback em_cb = EM_DATA_CB(of_dev_pm_opp_get_cpu_power);
>
> cpu_dev = get_cpu_device(policy->cpu);
> if (!cpu_dev) {
> @@ -135,6 +137,7 @@ static int scpi_cpufreq_init(struct cpufreq_policy *policy)
> ret = -EPROBE_DEFER;
> goto out_free_opp;
> }
> + nr_opp = ret;

Same comment here.

--
viresh

\
 
 \ /
  Last update: 2019-01-29 06:32    [W:0.186 / U:68.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site