summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-11-03 20:47:48 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-11-04 15:09:06 +0100
commit342d3a73c5dbc2f1cd0c5142e2d11bda4dc54cd7 (patch)
tree037f88f844e911b0a1738286f84372ab33b4be84 /include/linux
parenteee2a44e4e2b41c0699919a550d41cc38daa4f42 (diff)
cpufreq: Force passing target frequency to driver during resume
The policy->cur value preserved across a system suspend-resume cycle may become stale in some cases and it may prevent the CPU performance scaling logic from being updated due to the target_freq == policy->cur check in __cpufreq_driver_target() [1]. To address this, adjust the existing mechanism to force the invocation of the driver .target() callback in __cpufreq_driver_target() and make cpufreq_resume_policy() use it. This involves renaming update_limits in struct cpufreq_policy to force_target and moving the driver CPUFREQ_NEED_UPDATE_LIMITS flag check from __cpufreq_driver_target() to cpufreq_set_policy(), where it is used as a condition for setting policy->force_target. In cpufreq_resume_policy(), policy->force_target is set for drivers that implement the .target() callback, but don't implement the .get() one, which is the case when the driver callback needs to run if policy->cur becomes stale while suspended. Fixes: 2f0aea936360 ("cpufreq: suspend governors on system suspend/hibernate") Link: https://lore.kernel.org/linux-pm/20261027143725.3763827-1-zakbrightonknight@gmail.com/ [1] Reported-by: Zak Brighton Knight <zakbrightonknight@gmail.com> Reported-by: Doug Smythies <dsmythies@telus.net> Cc: All applicable <stable@vger.kernel.org> # eee2a44e4e2b cpufreq: Improve suspend-resume synchronization Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Zak Brighton Knight <zakbrightonknight@gmail.com> Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Tested-by: Doug Smythies <dsmythies@telus.net> Tested-by: Christian Loehle <christian.loehle@arm.com> Link: https://patch.msgid.link/1995295.tdWV9SEqCh@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cpufreq.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 20a6863b640a..be1eaa43aeb0 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -146,8 +146,8 @@ struct cpufreq_policy {
/* Per policy boost supported flag. */
bool boost_supported;
- /* Pending policy->min/max update for the driver */
- bool update_limits;
+ /* Force passing target frequency to the driver. */
+ bool force_target;
/* The policy has been suspended. */
bool suspended;