Commit ace120dc authored by Steven Rostedt's avatar Steven Rostedt Committed by Zhang Rui

Thermal: Fix lockup of cpu_down()

Commit f1a18a10 "Thermal: CPU Package temperature thermal" had code
that did a get_online_cpus(), run a loop and then do a
put_online_cpus(). The problem is that the loop had an error exit that
would skip the put_online_cpus() part.

In the error exit part of the function, it also did a get_online_cpus(),
run a loop and then put_online_cpus(). The only way to get to the error
exit part is with get_online_cpus() already performed. If this error
condition is hit, the system will be prevented from taking CPUs offline.
The process taking the CPU offline will lock up hard.

Removing the get_online_cpus() removes the lockup as the hotplug CPU
refcount is back to zero.

This was bisected with ktest.
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
parent 94e791f5
...@@ -599,7 +599,6 @@ static int __init pkg_temp_thermal_init(void) ...@@ -599,7 +599,6 @@ static int __init pkg_temp_thermal_init(void)
return 0; return 0;
err_ret: err_ret:
get_online_cpus();
for_each_online_cpu(i) for_each_online_cpu(i)
put_core_offline(i); put_core_offline(i);
put_online_cpus(); put_online_cpus();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment