aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2025-04-24 21:50:18 +0530
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-04-25 18:28:22 +0200
commit121baab7b88ed865532dadb7ef1aee6e2bea86f5 (patch)
treea8dd3cef5c94552e04959013b9a1b249a8c16fa1 /drivers/cpufreq
parentcpufreq: Preserve policy's boost state after resume (diff)
downloadlinux-rng-121baab7b88ed865532dadb7ef1aee6e2bea86f5.tar.xz
linux-rng-121baab7b88ed865532dadb7ef1aee6e2bea86f5.zip
cpufreq: Force sync policy boost with global boost on sysfs update
If the global boost flag is enabled and policy boost flag is disabled, a call to `cpufreq_boost_trigger_state(true)` must enable the policy's boost state. The current code misses that because of an optimization. Fix it. Suggested-by: Lifeng Zheng <zhenglifeng1@huawei.com> Reviewed-by: Lifeng Zheng <zhenglifeng1@huawei.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://patch.msgid.link/852ff11c589e6300730d207baac195b2d9d8b95f.1745511526.git.viresh.kumar@linaro.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 464bf20bcebf..4048103e2597 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2809,8 +2809,10 @@ static int cpufreq_boost_trigger_state(int state)
unsigned long flags;
int ret = 0;
- if (cpufreq_driver->boost_enabled == state)
- return 0;
+ /*
+ * Don't compare 'cpufreq_driver->boost_enabled' with 'state' here to
+ * make sure all policies are in sync with global boost flag.
+ */
write_lock_irqsave(&cpufreq_driver_lock, flags);
cpufreq_driver->boost_enabled = state;