From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Viresh Kumar <viresh.kumar@linaro.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.12.y 1/3] cpufreq: Introduce policy->boost_supported flag
Date: Wed, 25 Nov 2026 12:09:25 -0500 [thread overview]
Message-ID: <20261125170915.923901-1-sashal@kernel.org> (raw)
In-Reply-To: <2026112538-unwomanly-unwrapped-9118@gregkh>
From: Viresh Kumar <viresh.kumar@linaro.org>
[ Upstream commit 1f7d1bab50e6ae517f8b6699e56d709d61ae13e5 ]
It is possible to have a scenario where not all cpufreq policies support
boost frequencies. And letting sysfs (or other parts of the kernel)
enable boost feature for that policy isn't correct.
Add a new flag, boost_supported, which will be set to true by the
cpufreq core only if the freq table contains valid boost frequencies.
Some cpufreq drivers though don't have boost frequencies in the
freq-table, they can set this flag from their ->init() callbacks.
Once all the drivers are updated to set the flag correctly, we can check
it before enabling boost feature for a policy.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Stable-dep-of: 75120f31aed0 ("cpufreq: Fix updates of cached resolved frequency and index")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cpufreq/freq_table.c | 4 ++++
include/linux/cpufreq.h | 3 +++
2 files changed, 7 insertions(+)
diff --git a/drivers/cpufreq/freq_table.c b/drivers/cpufreq/freq_table.c
index 178e17009a16e..9db21ffc11979 100644
--- a/drivers/cpufreq/freq_table.c
+++ b/drivers/cpufreq/freq_table.c
@@ -367,6 +367,10 @@ int cpufreq_table_validate_and_sort(struct cpufreq_policy *policy)
if (ret)
return ret;
+ /* Driver's may have set this field already */
+ if (policy_has_boost_freq(policy))
+ policy->boost_supported = true;
+
return set_freq_table_sorted(policy);
}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 1e87507ea16ff..3ad7964711cb2 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -147,6 +147,9 @@ struct cpufreq_policy {
/* Per policy boost enabled flag. */
bool boost_enabled;
+ /* Per policy boost supported flag. */
+ bool boost_supported;
+
/* Cached frequency lookup from cpufreq_driver_resolve_freq. */
unsigned int cached_target_freq;
unsigned int cached_resolved_idx;
--
2.53.0
next prev parent reply other threads:[~2026-11-25 17:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 10:10 FAILED: patch "[PATCH] cpufreq: Fix updates of cached resolved frequency and index" failed to apply to 6.12-stable tree gregkh
2026-11-25 17:09 ` Sasha Levin [this message]
2026-11-25 17:09 ` [PATCH 6.12.y 2/3] cpufreq: Avoid redundant target() calls for unchanged limits Sasha Levin
2026-11-25 17:09 ` [PATCH 6.12.y 3/3] cpufreq: Fix updates of cached resolved frequency and index Sasha Levin
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=20261125170915.923901-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=stable@vger.kernel.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