Skip to content

Commit 1608f02

Browse files
Lifeng Zhengrafaeljw
authored andcommitted
cpufreq: Fix re-boost issue after hotplugging a CPU
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 <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://patch.msgid.link/[email protected] [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 43855ac commit 1608f02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/cpufreq/cpufreq.c

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

14771477
blocking_notifier_call_chain(&cpufreq_policy_notifier_list,
14781478
CPUFREQ_CREATE_POLICY, policy);
1479+
} else {
1480+
ret = freq_qos_update_request(policy->max_freq_req, policy->max);
1481+
if (ret < 0)
1482+
goto out_destroy_policy;
14791483
}
14801484

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

0 commit comments

Comments
 (0)