Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] cpufreq: remove setting of policy->cpu in policy->cpus during init
@ 2017-08-10 14:58 Sudeep Holla
  2017-08-11  5:09 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Sudeep Holla @ 2017-08-10 14:58 UTC (permalink / raw)
  To: linux-pm; +Cc: Sudeep Holla, Rafael J . Wysocki, Viresh Kumar

policy->cpu is copied into policy->cpus in cpufreq_online() before
calling into cpufreq_driver->init(). So there's no need to set the
same in the individual driver init() functions again.

This patch removes the redundant setting of policy->cpu in policy->cpus
in intel_pstate and cppc drivers.

Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/cpufreq/cppc_cpufreq.c | 1 -
 drivers/cpufreq/intel_pstate.c | 1 -
 2 files changed, 2 deletions(-)

Hi Viresh,

I had copied the cpumask_set_cpu from one of these drivers and when you
pointed out I thought it's better to remove the reference too. Let me
know if it makes sense.

Regards,
Sudeep

diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 10be285c9055..a1c3025f9df7 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -172,7 +172,6 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 		return -EFAULT;
 	}

-	cpumask_set_cpu(policy->cpu, policy->cpus);
 	cpu->cur_policy = policy;

 	/* Set policy->cur to max now. The governors will adjust later. */
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 0566455f233e..d82429859103 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2133,7 +2133,6 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy)
 	policy->cpuinfo.max_freq *= cpu->pstate.scaling;

 	intel_pstate_init_acpi_perf_limits(policy);
-	cpumask_set_cpu(policy->cpu, policy->cpus);

 	policy->fast_switch_possible = true;

--
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: remove setting of policy->cpu in policy->cpus during init
  2017-08-10 14:58 [PATCH] cpufreq: remove setting of policy->cpu in policy->cpus during init Sudeep Holla
@ 2017-08-11  5:09 ` Viresh Kumar
  2017-08-22 13:28   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2017-08-11  5:09 UTC (permalink / raw)
  To: Sudeep Holla; +Cc: linux-pm, Rafael J . Wysocki

On 10-08-17, 15:58, Sudeep Holla wrote:
> policy->cpu is copied into policy->cpus in cpufreq_online() before
> calling into cpufreq_driver->init(). So there's no need to set the
> same in the individual driver init() functions again.
> 
> This patch removes the redundant setting of policy->cpu in policy->cpus
> in intel_pstate and cppc drivers.
> 
> Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 1 -
>  drivers/cpufreq/intel_pstate.c | 1 -
>  2 files changed, 2 deletions(-)
> 
> Hi Viresh,
> 
> I had copied the cpumask_set_cpu from one of these drivers and when you
> pointed out I thought it's better to remove the reference too. Let me
> know if it makes sense.
> 
> Regards,
> Sudeep
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 10be285c9055..a1c3025f9df7 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -172,7 +172,6 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  		return -EFAULT;
>  	}
> 
> -	cpumask_set_cpu(policy->cpu, policy->cpus);
>  	cpu->cur_policy = policy;
> 
>  	/* Set policy->cur to max now. The governors will adjust later. */
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 0566455f233e..d82429859103 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -2133,7 +2133,6 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy)
>  	policy->cpuinfo.max_freq *= cpu->pstate.scaling;
> 
>  	intel_pstate_init_acpi_perf_limits(policy);
> -	cpumask_set_cpu(policy->cpu, policy->cpus);
> 
>  	policy->fast_switch_possible = true;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpufreq: remove setting of policy->cpu in policy->cpus during init
  2017-08-11  5:09 ` Viresh Kumar
@ 2017-08-22 13:28   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2017-08-22 13:28 UTC (permalink / raw)
  To: Viresh Kumar, Sudeep Holla; +Cc: linux-pm

On Friday, August 11, 2017 7:09:02 AM CEST Viresh Kumar wrote:
> On 10-08-17, 15:58, Sudeep Holla wrote:
> > policy->cpu is copied into policy->cpus in cpufreq_online() before
> > calling into cpufreq_driver->init(). So there's no need to set the
> > same in the individual driver init() functions again.
> > 
> > This patch removes the redundant setting of policy->cpu in policy->cpus
> > in intel_pstate and cppc drivers.
> > 
> > Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Reported-by: Viresh Kumar <viresh.kumar@linaro.org>
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/cpufreq/cppc_cpufreq.c | 1 -
> >  drivers/cpufreq/intel_pstate.c | 1 -
> >  2 files changed, 2 deletions(-)
> > 
> > Hi Viresh,
> > 
> > I had copied the cpumask_set_cpu from one of these drivers and when you
> > pointed out I thought it's better to remove the reference too. Let me
> > know if it makes sense.
> > 
> > Regards,
> > Sudeep
> > 
> > diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> > index 10be285c9055..a1c3025f9df7 100644
> > --- a/drivers/cpufreq/cppc_cpufreq.c
> > +++ b/drivers/cpufreq/cppc_cpufreq.c
> > @@ -172,7 +172,6 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
> >  		return -EFAULT;
> >  	}
> > 
> > -	cpumask_set_cpu(policy->cpu, policy->cpus);
> >  	cpu->cur_policy = policy;
> > 
> >  	/* Set policy->cur to max now. The governors will adjust later. */
> > diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> > index 0566455f233e..d82429859103 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -2133,7 +2133,6 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy)
> >  	policy->cpuinfo.max_freq *= cpu->pstate.scaling;
> > 
> >  	intel_pstate_init_acpi_perf_limits(policy);
> > -	cpumask_set_cpu(policy->cpu, policy->cpus);
> > 
> >  	policy->fast_switch_possible = true;
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 
> 

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-22 13:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 14:58 [PATCH] cpufreq: remove setting of policy->cpu in policy->cpus during init Sudeep Holla
2017-08-11  5:09 ` Viresh Kumar
2017-08-22 13:28   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox