From: Penghe Geng <pgeng@nvidia.com>
To: "Rafael J . Wysocki" <rafael@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
Ionela Voinescu <ionela.voinescu@arm.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Penghe Geng <pgeng@nvidia.com>
Subject: [PATCH] cpufreq: cppc: drop invariance when FIE is disabled
Date: Fri, 20 Feb 2026 17:49:20 -0500 [thread overview]
Message-ID: <20260220224920.416602-1-pgeng@nvidia.com> (raw)
CONFIG_ACPI_CPPC_CPUFREQ_FIE gates CPPC counter-based frequency
invariance support. When FIE is disabled, the CPPC driver does not
register a frequency scale source, but cpufreq_register_driver() still
enables cpufreq_freq_invariance for target/fast-switch drivers.
Disable cpufreq frequency invariance after CPPC driver registration when
FIE is disabled. This avoids scheduler behavior mismatch when no
invariance updates are provided, which can cause major performance
regressions on sensitive platforms.
Export cpufreq_disable_freq_invariance() so modular cppc_cpufreq can call
it.
Fixes: 1eb5dde674f5 ("cpufreq: CPPC: Add support for frequency invariance")
Cc: stable@vger.kernel.org
Signed-off-by: Penghe Geng <pgeng@nvidia.com>
---
drivers/cpufreq/cppc_cpufreq.c | 4 ++++
drivers/cpufreq/cpufreq.c | 8 ++++++++
include/linux/cpufreq.h | 3 +++
3 files changed, 15 insertions(+)
diff --git a/drivers/cpufreq/cppc_cpufreq.c b/drivers/cpufreq/cppc_cpufreq.c
index 7e8042efedd1..ad96dfb731ab 100644
--- a/drivers/cpufreq/cppc_cpufreq.c
+++ b/drivers/cpufreq/cppc_cpufreq.c
@@ -952,6 +952,10 @@ static int __init cppc_cpufreq_init(void)
ret = cpufreq_register_driver(&cppc_cpufreq_driver);
if (ret)
cppc_freq_invariance_exit();
+#ifndef CONFIG_ACPI_CPPC_CPUFREQ_FIE
+ else
+ cpufreq_disable_freq_invariance();
+#endif
return ret;
}
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index a7a69f4d7675..4e79f704a8e7 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -66,6 +66,14 @@ bool cpufreq_supports_freq_invariance(void)
return static_branch_likely(&cpufreq_freq_invariance);
}
+void cpufreq_disable_freq_invariance(void)
+{
+ cpus_read_lock();
+ static_branch_disable_cpuslocked(&cpufreq_freq_invariance);
+ cpus_read_unlock();
+}
+EXPORT_SYMBOL_GPL(cpufreq_disable_freq_invariance);
+
/* Flag to suspend/resume CPUFreq governors */
static bool cpufreq_suspended;
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index cc894fc38971..698b8e044e89 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -249,6 +249,7 @@ void cpufreq_update_policy(unsigned int cpu);
void cpufreq_update_limits(unsigned int cpu);
bool have_governor_per_policy(void);
bool cpufreq_supports_freq_invariance(void);
+void cpufreq_disable_freq_invariance(void);
struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
void cpufreq_enable_fast_switch(struct cpufreq_policy *policy);
void cpufreq_disable_fast_switch(struct cpufreq_policy *policy);
@@ -280,6 +281,8 @@ static inline bool cpufreq_supports_freq_invariance(void)
{
return false;
}
+
+static inline void cpufreq_disable_freq_invariance(void) { }
static inline void disable_cpufreq(void) { }
static inline void cpufreq_update_limits(unsigned int cpu) { }
static inline unsigned long cpufreq_get_pressure(int cpu)
--
2.43.0
next reply other threads:[~2026-02-20 22:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 22:49 Penghe Geng [this message]
2026-02-25 4:08 ` [PATCH] cpufreq: cppc: drop invariance when FIE is disabled Jie Zhan
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=20260220224920.416602-1-pgeng@nvidia.com \
--to=pgeng@nvidia.com \
--cc=ionela.voinescu@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@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