mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq: acpi: Don't enable boost on policy exit
@ 2025-04-16  5:29 Viresh Kumar
  2025-04-16  8:47 ` zhenglifeng (A)
  2025-04-17  1:54 ` Nicholas Chin
  0 siblings, 2 replies; 20+ messages in thread
From: Viresh Kumar @ 2025-04-16  5:29 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Lifeng Zheng
  Cc: linux-pm, Vincent Guittot, Nicholas Chin, Rafael J. Wysocki,
	linux-kernel

The boost-related code in cpufreq has undergone several changes over the
years, but this particular piece remained unchanged and is now outdated.

The cpufreq core currently manages boost settings during initialization,
and only when necessary. As such, there's no longer a need to enable
boost explicitly when entering system suspend.

Previously, this wasn’t causing issues because boost settings were
force-updated during policy initialization. However, commit 2b16c631832d
("cpufreq: ACPI: Remove set_boost in acpi_cpufreq_cpu_init()") changed
that behavior—correctly—by avoiding unnecessary updates.

As a result of this change, if boost was disabled prior to suspend, it
remains disabled on resume—as expected. But due to the current code
forcibly enabling boost at suspend time, the system ends up with boost
frequencies enabled after resume, even if the global boost flag was
disabled. This contradicts the intended behavior.

Fix this by not enabling boost on policy exit.

Fixes: 2b16c631832d ("cpufreq: ACPI: Remove set_boost in acpi_cpufreq_cpu_init()")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220013
Reported-by: Nicholas Chin <nic.c3.14@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/acpi-cpufreq.c | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 924314cdeebc..85b5a88f723f 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -89,8 +89,9 @@ static bool boost_state(unsigned int cpu)
 	return false;
 }
 
-static int boost_set_msr(bool enable)
+static void boost_set_msr_each(void *p_en)
 {
+	bool enable = (bool) p_en;
 	u32 msr_addr;
 	u64 msr_mask, val;
 
@@ -107,7 +108,7 @@ static int boost_set_msr(bool enable)
 		msr_mask = MSR_K7_HWCR_CPB_DIS;
 		break;
 	default:
-		return -EINVAL;
+		return;
 	}
 
 	rdmsrl(msr_addr, val);
@@ -118,14 +119,6 @@ static int boost_set_msr(bool enable)
 		val |= msr_mask;
 
 	wrmsrl(msr_addr, val);
-	return 0;
-}
-
-static void boost_set_msr_each(void *p_en)
-{
-	bool enable = (bool) p_en;
-
-	boost_set_msr(enable);
 }
 
 static int set_boost(struct cpufreq_policy *policy, int val)
@@ -532,15 +525,6 @@ static void free_acpi_perf_data(void)
 	free_percpu(acpi_perf_data);
 }
 
-static int cpufreq_boost_down_prep(unsigned int cpu)
-{
-	/*
-	 * Clear the boost-disable bit on the CPU_DOWN path so that
-	 * this cpu cannot block the remaining ones from boosting.
-	 */
-	return boost_set_msr(1);
-}
-
 /*
  * acpi_cpufreq_early_init - initialize ACPI P-States library
  *
@@ -931,7 +915,6 @@ static void acpi_cpufreq_cpu_exit(struct cpufreq_policy *policy)
 
 	pr_debug("%s\n", __func__);
 
-	cpufreq_boost_down_prep(policy->cpu);
 	policy->fast_switch_possible = false;
 	policy->driver_data = NULL;
 	acpi_processor_unregister_performance(data->acpi_perf_cpu);
-- 
2.31.1.272.g89b43f80a514


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-04-22 12:05 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-16  5:29 [PATCH] cpufreq: acpi: Don't enable boost on policy exit Viresh Kumar
2025-04-16  8:47 ` zhenglifeng (A)
2025-04-16 12:38   ` Rafael J. Wysocki
2025-04-17  1:54 ` Nicholas Chin
2025-04-17  5:02   ` Viresh Kumar
2025-04-17  5:09     ` Viresh Kumar
2025-04-17 12:39       ` Rafael J. Wysocki
2025-04-17 15:53         ` Rafael J. Wysocki
2025-04-18  5:58           ` Viresh Kumar
2025-04-18 17:06             ` Nicholas Chin
2025-04-18 19:28               ` Rafael J. Wysocki
2025-04-19  7:54                 ` Viresh Kumar
2025-04-19  9:35                   ` zhenglifeng (A)
2025-04-21  6:20                     ` Viresh Kumar
2025-04-21  7:45                       ` zhenglifeng (A)
2025-04-21 11:37                     ` Viresh Kumar
2025-04-21 13:36                       ` zhenglifeng (A)
2025-04-22  9:41                         ` Viresh Kumar
2025-04-22 12:05                           ` zhenglifeng (A)
2025-04-17 12:36     ` Rafael J. Wysocki

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®