[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190410054449.zwmemg7vza557gue@vireshk-i7>
Date: Wed, 10 Apr 2019 11:14:49 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Quentin Perret <quentin.perret@....com>
Cc: edubezval@...il.com, rui.zhang@...el.com, javi.merino@...nel.org,
amit.kachhap@...il.com, rjw@...ysocki.net, will.deacon@....com,
catalin.marinas@....com, daniel.lezcano@...aro.org,
dietmar.eggemann@....com, ionela.voinescu@....com,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 3/3] thermal: cpu_cooling: Migrate to using the EM
framework
On 28-03-19, 10:13, Quentin Perret wrote:
> +static unsigned int get_state_freq(struct cpufreq_cooling_device *cpufreq_cdev,
> + unsigned long state)
> +{
> + struct cpufreq_policy *policy;
> + unsigned long idx;
> +
> + /* Use the Energy Model table if available */
> + if (cpufreq_cdev->em) {
> + idx = cpufreq_cdev->max_level - state;
> + return cpufreq_cdev->em->table[idx].frequency;
> + }
> +
> + /* Otherwise, fallback on the CPUFreq table */
> + policy = cpufreq_cdev->policy;
> + if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING)
It is not guaranteed that the frequency table is sorted in any order, isn't it ?
> + idx = cpufreq_cdev->max_level - state;
> + else
> + idx = state;
--
viresh
Powered by blists - more mailing lists