Linux Power Management development
 help / color / mirror / Atom feed
From: "zhenglifeng (A)" <zhenglifeng1@huawei.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>
Cc: <linux-pm@vger.kernel.org>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 06/15] cpufreq: cppc: Set policy->boost_supported
Date: Thu, 6 Feb 2025 11:58:51 +0800	[thread overview]
Message-ID: <d7acce9e-fafc-4b1d-80f9-2ddc46b5a28d@huawei.com> (raw)
In-Reply-To: <c744751c8f61cae509959270176ebdef77326ba2.1737707712.git.viresh.kumar@linaro.org>

On 2025/1/24 16:58, Viresh Kumar wrote:

> With a later commit, the cpufreq core will call the ->set_boost()
> callback only if the policy supports boost frequency. The
> boost_supported flag is set by the cpufreq core if policy->freq_table is
> set and one or more boost frequencies are present.
> 
> For other drivers, the flag must be set explicitly.
> 
> With this, the local variable boost_supported isn't required anymore.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index 7fa89b601d2a..08117fb9c1eb 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -34,8 +34,6 @@
>   */
>  static LIST_HEAD(cpu_data_list);
>  
> -static bool boost_supported;
> -
>  static struct cpufreq_driver cppc_cpufreq_driver;
>  
>  #ifdef CONFIG_ACPI_CPPC_CPUFREQ_FIE
> @@ -653,7 +651,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  	 * is supported.
>  	 */
>  	if (caps->highest_perf > caps->nominal_perf)
> -		boost_supported = true;
> +		policy->boost_supported = true;
>  
>  	/* Set policy->cur to max now. The governors will adjust later. */
>  	policy->cur = cppc_perf_to_khz(caps, caps->highest_perf);
> @@ -791,11 +789,6 @@ static int cppc_cpufreq_set_boost(struct cpufreq_policy *policy, int state)
>  	struct cppc_perf_caps *caps = &cpu_data->perf_caps;
>  	int ret;
>  
> -	if (!boost_supported) {
> -		pr_err("BOOST not supported by CPU or firmware\n");
> -		return -EINVAL;
> -	}
> -
>  	if (state)
>  		policy->max = cppc_perf_to_khz(caps, caps->highest_perf);
>  	else

I have a little question. With the old boost_supported flag as false, it
will fail when you operate the global boost flag. But if you replace it
with the per-policy boost_supported flag, the global boost_enabled flag can
be set to true without any error, even no policy's boost_enabled flag
changed. Is this interface behavior change OK?

  reply	other threads:[~2025-02-06  3:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24  8:58 [PATCH 00/15] cpufreq: simplify boost handling Viresh Kumar
2025-01-24  8:58 ` [PATCH 01/15] cpufreq: staticize cpufreq_boost_trigger_state() Viresh Kumar
2025-01-24  8:58 ` [PATCH 02/15] cpufreq: Export cpufreq_boost_set_sw() Viresh Kumar
2025-01-24  8:58 ` [PATCH 03/15] cpufreq: Introduce policy->boost_supported flag Viresh Kumar
2025-01-24  8:58 ` [PATCH 04/15] cpufreq: acpi: Set policy->boost_supported Viresh Kumar
2025-01-24  8:58 ` [PATCH 05/15] cpufreq: amd: " Viresh Kumar
2025-01-30  9:15   ` Dhananjay Ugwekar
2025-01-24  8:58 ` [PATCH 06/15] cpufreq: cppc: " Viresh Kumar
2025-02-06  3:58   ` zhenglifeng (A) [this message]
2025-02-06  5:27     ` Viresh Kumar
2025-02-06  6:27   ` zhenglifeng (A)
2025-01-24  8:58 ` [PATCH 07/15] cpufreq: Restrict enabling boost on policies with no boost frequencies Viresh Kumar
2025-01-24  8:58 ` [PATCH 08/15] cpufreq: apple: Set .set_boost directly Viresh Kumar
2025-01-24  8:58 ` [PATCH 09/15] cpufreq: loongson: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 10/15] cpufreq: powernv: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 11/15] cpufreq: scmi: " Viresh Kumar
2025-01-28 11:27   ` Sudeep Holla
2025-01-24  8:58 ` [PATCH 12/15] cpufreq: dt: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 13/15] cpufreq: qcom: " Viresh Kumar
2025-01-24  8:58 ` [PATCH 14/15] cpufreq: staticize policy_has_boost_freq() Viresh Kumar
2025-01-24  8:58 ` [PATCH 15/15] cpufreq: Remove cpufreq_enable_boost_support() Viresh Kumar
2025-01-24 11:05 ` [PATCH 00/15] cpufreq: simplify boost handling Rafael J. Wysocki
2025-01-27  3:32   ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d7acce9e-fafc-4b1d-80f9-2ddc46b5a28d@huawei.com \
    --to=zhenglifeng1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox