diff mbox

[2/7] cpufreq-dt: pass 'policy->related_cpus' to of_cpufreq_cooling_register()

Message ID 4a62588b693c1ab0de09c59da38c03c7ae9c4c06.1416980448.git.viresh.kumar@linaro.org (mailing list archive)
State RFC, archived
Headers show

Commit Message

Viresh Kumar Nov. 26, 2014, 5:52 a.m. UTC
The second parameter of of_cpufreq_cooling_register() should be the CPUs to
which the frequency constraint will apply. As the cpufreq-dt driver now supports
platforms with multiple 'struct cpufreq_policy' instances (i.e. > 1 clock
domains for CPUs), passing 'cpu_present_mask' isn't correct anymore. As every
policy will have a set of CPUs and that may not be equal to 'cpu_present_mask'
always.

So, pass only mask of CPUs which are controlled by current policy.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq-dt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Eduardo Valentin Nov. 26, 2014, 5:55 p.m. UTC | #1
On Wed, Nov 26, 2014 at 11:22:57AM +0530, Viresh Kumar wrote:
> The second parameter of of_cpufreq_cooling_register() should be the CPUs to
> which the frequency constraint will apply. As the cpufreq-dt driver now supports
> platforms with multiple 'struct cpufreq_policy' instances (i.e. > 1 clock
> domains for CPUs), passing 'cpu_present_mask' isn't correct anymore. As every
> policy will have a set of CPUs and that may not be equal to 'cpu_present_mask'
> always.
> 
> So, pass only mask of CPUs which are controlled by current policy.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

Reviewed-by: Eduardo Valentin <edubezval@gmail.com>
Tested-by: Eduardo Valentin <edubezval@gmail.com>

> ---
>  drivers/cpufreq/cpufreq-dt.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
> index 8cba13d..7374fc4 100644
> --- a/drivers/cpufreq/cpufreq-dt.c
> +++ b/drivers/cpufreq/cpufreq-dt.c
> @@ -274,7 +274,7 @@ static int cpufreq_init(struct cpufreq_policy *policy)
>  	 * thermal DT code takes care of matching them.
>  	 */
>  	if (of_find_property(np, "#cooling-cells", NULL)) {
> -		cdev = of_cpufreq_cooling_register(np, cpu_present_mask);
> +		cdev = of_cpufreq_cooling_register(np, policy->related_cpus);
>  		if (IS_ERR(cdev))
>  			dev_err(cpu_dev,
>  				"running cpufreq without cooling device: %ld\n",
> -- 
> 2.0.3.693.g996b0fd
>
diff mbox

Patch

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 8cba13d..7374fc4 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -274,7 +274,7 @@  static int cpufreq_init(struct cpufreq_policy *policy)
 	 * thermal DT code takes care of matching them.
 	 */
 	if (of_find_property(np, "#cooling-cells", NULL)) {
-		cdev = of_cpufreq_cooling_register(np, cpu_present_mask);
+		cdev = of_cpufreq_cooling_register(np, policy->related_cpus);
 		if (IS_ERR(cdev))
 			dev_err(cpu_dev,
 				"running cpufreq without cooling device: %ld\n",