Commit 90b4f30b authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Guenter Roeck

hwmon: (coretemp) Handle frozen hotplug state correctly

The recent conversion to the hotplug state machine missed that the original
hotplug notifiers did not execute in the frozen state, which is used on
suspend on resume.

This does not matter on single socket machines, but on multi socket systems
this breaks when the device for a non-boot socket is removed when the last
CPU of that socket is brought offline. The device removal locks up the
machine hard w/o any debug output.

Prevent executing the hotplug callbacks when cpuhp_tasks_frozen is true.

Thanks to Tommi for providing debug information patiently while I failed to
spot the obvious.

Fixes: e00ca5df ("hwmon: (coretemp) Convert to hotplug state machine")
Reported-by: default avatarTommi Rantala <tt.rantala@gmail.com>
Tested-by: default avatarTommi Rantala <tt.rantala@gmail.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 2ea659a9
...@@ -604,6 +604,13 @@ static int coretemp_cpu_online(unsigned int cpu) ...@@ -604,6 +604,13 @@ static int coretemp_cpu_online(unsigned int cpu)
struct cpuinfo_x86 *c = &cpu_data(cpu); struct cpuinfo_x86 *c = &cpu_data(cpu);
struct platform_data *pdata; struct platform_data *pdata;
/*
* Don't execute this on resume as the offline callback did
* not get executed on suspend.
*/
if (cpuhp_tasks_frozen)
return 0;
/* /*
* CPUID.06H.EAX[0] indicates whether the CPU has thermal * CPUID.06H.EAX[0] indicates whether the CPU has thermal
* sensors. We check this bit only, all the early CPUs * sensors. We check this bit only, all the early CPUs
...@@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsigned int cpu) ...@@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsigned int cpu)
struct temp_data *tdata; struct temp_data *tdata;
int indx, target; int indx, target;
/*
* Don't execute this on suspend as the device remove locks
* up the machine.
*/
if (cpuhp_tasks_frozen)
return 0;
/* If the physical CPU device does not exist, just return */ /* If the physical CPU device does not exist, just return */
if (!pdev) if (!pdev)
return 0; return 0;
......
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