public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: Clarify the comment in cpufreq_set_policy()
@ 2019-10-22 10:17 Viresh Kumar
  2019-10-28 15:23 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Viresh Kumar @ 2019-10-22 10:17 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar
  Cc: linux-pm, Vincent Guittot, Rafael J . Wysocki, linux-kernel

One of the responsibility of the ->verify() callback is to make sure
that the policy's min frequency is <= max frequency as this isn't
guaranteed by the QoS framework which gave us those values.

Update the comment in cpufreq_set_policy() to clarify that.

Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 2e698b5f0f80..b4b5f11c2f1e 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2384,7 +2384,10 @@ int cpufreq_set_policy(struct cpufreq_policy *policy,
 	new_policy->min = freq_qos_read_value(&policy->constraints, FREQ_QOS_MIN);
 	new_policy->max = freq_qos_read_value(&policy->constraints, FREQ_QOS_MAX);
 
-	/* verify the cpu speed can be set within this limit */
+	/*
+	 * Verify that the cpu speed can be set within this limit and make sure
+	 * min <= max.
+	 */
 	ret = cpufreq_driver->verify(new_policy);
 	if (ret)
 		return ret;
-- 
2.21.0.rc0.269.g1a574e7a288b


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

* Re: [PATCH] cpufreq: Clarify the comment in cpufreq_set_policy()
  2019-10-22 10:17 [PATCH] cpufreq: Clarify the comment in cpufreq_set_policy() Viresh Kumar
@ 2019-10-28 15:23 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2019-10-28 15:23 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: linux-pm, Vincent Guittot, Rafael J . Wysocki, linux-kernel

On Tuesday, October 22, 2019 12:17:57 PM CET Viresh Kumar wrote:
> One of the responsibility of the ->verify() callback is to make sure
> that the policy's min frequency is <= max frequency as this isn't
> guaranteed by the QoS framework which gave us those values.
> 
> Update the comment in cpufreq_set_policy() to clarify that.
> 
> Suggested-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/cpufreq.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 2e698b5f0f80..b4b5f11c2f1e 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2384,7 +2384,10 @@ int cpufreq_set_policy(struct cpufreq_policy *policy,
>  	new_policy->min = freq_qos_read_value(&policy->constraints, FREQ_QOS_MIN);
>  	new_policy->max = freq_qos_read_value(&policy->constraints, FREQ_QOS_MAX);
>  
> -	/* verify the cpu speed can be set within this limit */
> +	/*
> +	 * Verify that the cpu speed can be set within this limit and make sure
> +	 * min <= max.
> +	 */
>  	ret = cpufreq_driver->verify(new_policy);
>  	if (ret)
>  		return ret;
> 

Applying for 5.5, thanks!





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

end of thread, other threads:[~2019-10-28 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-22 10:17 [PATCH] cpufreq: Clarify the comment in cpufreq_set_policy() Viresh Kumar
2019-10-28 15:23 ` 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