Linux Power Management development
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Lifeng Zheng <zhenglifeng1@huawei.com>
Cc: rafael@kernel.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com,
	jonathan.cameron@huawei.com, zhanjie9@hisilicon.com,
	lihuisong@huawei.com, fanghao11@huawei.com
Subject: Re: [PATCH v2 3/4] cpufreq: CPPC: Fix wrong max_freq in policy initialization
Date: Mon, 20 Jan 2025 14:58:47 +0530	[thread overview]
Message-ID: <20250120092847.3qvayop636xceewc@vireshk-i7> (raw)
In-Reply-To: <20250117101457.1530653-4-zhenglifeng1@huawei.com>

On 17-01-25, 18:14, Lifeng Zheng wrote:
> In policy initialization, policy->max and policy->cpuinfo.max_freq always
> set to the value calculated from caps->nominal_perf. This will cause the
> frequency stay on base frequency even if the policy is already boosted when
> a CPU is going online. Fix this by using policy->boost_enabled to determine
> which value should be set.
> 
> Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
> ---
>  drivers/cpufreq/cppc_cpufreq.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
> index bd8f75accfa0..7fa89b601d2a 100644
> --- a/drivers/cpufreq/cppc_cpufreq.c
> +++ b/drivers/cpufreq/cppc_cpufreq.c
> @@ -611,7 +611,8 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  	 * Section 8.4.7.1.1.5 of ACPI 6.1 spec)
>  	 */
>  	policy->min = cppc_perf_to_khz(caps, caps->lowest_nonlinear_perf);
> -	policy->max = cppc_perf_to_khz(caps, caps->nominal_perf);
> +	policy->max = cppc_perf_to_khz(caps, policy->boost_enabled ?
> +						caps->highest_perf : caps->nominal_perf);
>  
>  	/*
>  	 * Set cpuinfo.min_freq to Lowest to make the full range of performance
> @@ -619,7 +620,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
>  	 * nonlinear perf
>  	 */
>  	policy->cpuinfo.min_freq = cppc_perf_to_khz(caps, caps->lowest_perf);
> -	policy->cpuinfo.max_freq = cppc_perf_to_khz(caps, caps->nominal_perf);
> +	policy->cpuinfo.max_freq = policy->max;
>  
>  	policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu);
>  	policy->shared_type = cpu_data->shared_type;

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

-- 
viresh

  reply	other threads:[~2025-01-20  9:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-17 10:14 [PATCH v2 0/4] cpufreq: Fix some boost errors related to CPU online and offline Lifeng Zheng
2025-01-17 10:14 ` [PATCH v2 1/4] cpufreq: Fix re-boost issue after hotplugging a cpu Lifeng Zheng
2025-01-20  8:27   ` Viresh Kumar
2025-01-20  9:10     ` zhenglifeng (A)
2025-01-20  9:21       ` Viresh Kumar
2025-01-20  9:21   ` Viresh Kumar
2025-01-17 10:14 ` [PATCH v2 2/4] cpufreq: Introduce a more generic way to set default per-policy boost flag Lifeng Zheng
2025-01-20  9:01   ` Viresh Kumar
2025-01-21  1:45     ` zhenglifeng (A)
2025-01-21  4:20       ` Viresh Kumar
2025-01-21  6:22         ` zhenglifeng (A)
2025-01-21  6:37           ` Viresh Kumar
2025-02-04 16:41   ` Aboorva Devarajan
2025-02-05  5:01     ` Viresh Kumar
2025-02-05 18:22       ` Aboorva Devarajan
2025-01-17 10:14 ` [PATCH v2 3/4] cpufreq: CPPC: Fix wrong max_freq in policy initialization Lifeng Zheng
2025-01-20  9:28   ` Viresh Kumar [this message]
2025-01-17 10:14 ` [PATCH v2 4/4] cpufreq: ACPI: Remove set_boost in acpi_cpufreq_cpu_init() Lifeng Zheng
2025-01-21  6:14   ` Viresh Kumar
2025-01-24  8:59     ` Viresh Kumar
2025-01-24  9:11       ` zhenglifeng (A)
2025-04-15 10:29   ` Viresh Kumar
2025-01-21  6:38 ` [PATCH v2 0/4] cpufreq: Fix some boost errors related to CPU online and offline Viresh Kumar
2025-01-23 20:07   ` Rafael J. Wysocki

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=20250120092847.3qvayop636xceewc@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=fanghao11@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=lihuisong@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=rafael@kernel.org \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    /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