From: Robin Murphy <robin.murphy@arm.com>
To: Christian Loehle <christian.loehle@arm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-pm <linux-pm@vger.kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
"Rafael J. Wysocki" <rafael@kernel.org>
Cc: zhenglifeng1@huawei.com
Subject: Re: [PATCH] cpufreq: Fix initialization with disabled boost
Date: Mon, 16 Jun 2025 20:10:37 +0100 [thread overview]
Message-ID: <34651625-08eb-46df-8075-4c5a08d15c18@arm.com> (raw)
In-Reply-To: <3cc5b83b-f81c-4bd7-b7ff-4d02db4e25d8@arm.com>
On 2025-06-16 6:25 pm, Christian Loehle wrote:
> The boost_enabled early return in policy_set_boost() caused
> the boost disabled at initialization to not actually set the
> initial policy->max, therefore effectively enabling boost while
> it should have been enabled.
>
> Fixes: 27241c8b63bd ("cpufreq: Introduce policy_set_boost()")
I think it's a bit older than that - I noticed this with 6.15 stable,
prior to that refactoring, and from a poke through the history the
underlying logic appears to date back to dd016f379ebc ("cpufreq:
Introduce a more generic way to set default per-policy boost flag").
Hopefully someone can figure out the appropriate stable backport.
I can at least confirm that equivalently hacking out the "&&
policy->boost_enabled != cpufreq_boost_enabled()" condition previously
here does have the desired effect for me of initialising
scaling_max_freq correctly at boot, but I'm not sure that's entirely
correct on its own...
Thanks,
Robin.
> Reported-by: Robin Murphy <robin.murphy@arm.com>
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
> ---
> drivers/cpufreq/cpufreq.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d7426e1d8bdd..e85139bd0436 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1630,7 +1630,7 @@ static int cpufreq_online(unsigned int cpu)
> */
> if (cpufreq_driver->set_boost && policy->boost_supported &&
> (new_policy || !cpufreq_boost_enabled())) {
> - ret = policy_set_boost(policy, cpufreq_boost_enabled());
> + ret = cpufreq_driver->set_boost(policy, cpufreq_boost_enabled());
> if (ret) {
> /* If the set_boost fails, the online operation is not affected */
> pr_info("%s: CPU%d: Cannot %s BOOST\n", __func__, policy->cpu,
next prev parent reply other threads:[~2025-06-16 19:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 17:25 Christian Loehle
2025-06-16 19:10 ` Robin Murphy [this message]
2025-06-17 2:14 ` zhenglifeng (A)
2025-06-17 8:20 ` Christian Loehle
2025-06-17 12:56 ` Robin Murphy
2025-06-19 6:48 ` Viresh Kumar
2025-06-18 14:32 ` Rafael J. Wysocki
2025-06-18 14:57 ` Christian Loehle
2025-06-23 22:16 ` Dietmar Eggemann
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=34651625-08eb-46df-8075-4c5a08d15c18@arm.com \
--to=robin.murphy@arm.com \
--cc=christian.loehle@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=viresh.kumar@linaro.org \
--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
all inboxes | Powered by JetHome®