Skip to content

Commit ebc5004

Browse files
Lifeng Zhengopsiff
authored andcommitted
cpufreq: Fix re-boost issue after hotplugging a CPU
mainline inclusion from maineline-v6.14-rc1 category: bugfix It turns out that CPUX will stay on the base frequency after performing these operations: 1. boost all CPUs: echo 1 > /sys/devices/system/cpu/cpufreq/boost 2. offline one CPU: echo 0 > /sys/devices/system/cpu/cpuX/online 3. deboost all CPUs: echo 0 > /sys/devices/system/cpu/cpufreq/boost 4. online CPUX: echo 1 > /sys/devices/system/cpu/cpuX/online 5. boost all CPUs again: echo 1 > /sys/devices/system/cpu/cpufreq/boost This is because max_freq_req of the policy is not updated during the online process, and the value of max_freq_req before the last offline is retained. When the CPU is boosted again, freq_qos_update_request() will do nothing because the old value is the same as the new one. This causes the CPU to stay at the base frequency. Updating max_freq_req in cpufreq_online() will solve this problem. Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Link: https://patch.msgid.link/20250117101457.1530653-2-zhenglifeng1@huawei.com [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> (cherry picked from commit 1608f02) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 0d3594d commit ebc5004

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/cpufreq/cpufreq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,10 @@ static int cpufreq_online(unsigned int cpu)
15041504

15051505
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
15061506
CPUFREQ_CREATE_POLICY, policy);
1507+
} else {
1508+
ret = freq_qos_update_request(policy->max_freq_req, policy->max);
1509+
if (ret < 0)
1510+
goto out_destroy_policy;
15071511
}
15081512

15091513
if (cpufreq_driver->get && has_target()) {

0 commit comments

Comments
 (0)