hwmon: (coretemp) Handle frozen hotplug state correctly
Subsystems (2)
PATCH 1/1 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.
--- drivers/hwmon/coretemp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/hwmon/coretemp.c +14 -0
@@ -605,6 +605,13 @@ static int coretemp_cpu_online(unsignedstruct 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 * sensors. We check this bit only, all the early CPUs * without thermal sensors will be filtered out.
@@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsignedstruct temp_data *tdata;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 (!pdev)return 0 ;
2017-05-10 17:30 GMT+03:00 Thomas Gleixner <[email protected]>:
Quoted 9 lines
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.
Quoted 8 lines
Prevent executing the hotplug callbacks when
cpuhp_tasks_frozenis true.Thanks to Tommi for providing debug information patiently while I failed to spot the obvious.
Fixes e00ca5df37ad ("hwmon: (coretemp) Convert to hotplug state machine")Reported-by Tommi Rantala <[email protected]>Signed-off-by Thomas Gleixner <[email protected]>
Many thanks, I can confirm that it works well!
-Tommi
Quoted 34 lines
--- drivers/hwmon/coretemp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/hwmon/coretemp.c +14
-0@@ -605,6 +605,13 @@ static int coretemp_cpu_online(unsignedstruct 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 * sensors. We check this bit only, all the early CPUs * without thermal sensors will be filtered out. @@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsignedstruct temp_data *tdata;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 (!pdev)return 0 ;
Guenter Roeck
maintainerQuoted 12 lines · Tommi Rantala
2017-05-10 17:30 GMT+03:00 Thomas Gleixner <[email protected]>:
Quoted 11 lines
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_frozenis true.
Quoted 9 lines
Quoted 6 lines
Thanks to Tommi for providing debug information patiently while I failed to spot the obvious.
Fixes e00ca5df37ad ("hwmon: (coretemp) Convert to hotplug state machine")Reported-by Tommi Rantala <[email protected]>Signed-off-by Thomas Gleixner <[email protected]>Many thanks, I can confirm that it works well!
Ok if I add your Tested-by: ?
Thanks,
Guenter
Quoted 36 lines
-Tommi
Quoted 34 lines
--- drivers/hwmon/coretemp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/hwmon/coretemp.c +14
-0@@ -605,6 +605,13 @@ static int coretemp_cpu_online(unsignedstruct 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 * sensors. We check this bit only, all the early CPUs * without thermal sensors will be filtered out. @@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsignedstruct temp_data *tdata;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 (!pdev)return 0 ;
Tommi Rantala
Tested-by2017-05-10 23:09 GMT+03:00 Guenter Roeck <[email protected]>:
Quoted 16 lines · Tommi Rantala
Quoted 15 lines
2017-05-10 17:30 GMT+03:00 Thomas Gleixner <[email protected]>:
Quoted 14 lines
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_frozenis true.Thanks to Tommi for providing debug information patiently while I failed to spot the obvious.
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
Fixes e00ca5df37ad ("hwmon: (coretemp) Convert to hotplug state machine")Reported-by Tommi Rantala <[email protected]>Signed-off-by Thomas Gleixner <[email protected]>Many thanks, I can confirm that it works well!
Ok if I add your Tested-by: ?
Sure!
Quoted 39 lines
Thanks,
GuenterQuoted 36 lines
-Tommi
Quoted 34 lines
--- drivers/hwmon/coretemp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/hwmon/coretemp.c +14
-0@@ -605,6 +605,13 @@ static int coretemp_cpu_online(unsignedstruct 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 * sensors. We check this bit only, all the early CPUs * without thermal sensors will be filtered out. @@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsignedstruct temp_data *tdata;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 (!pdev)return 0 ;
Quoted 9 lines · Thomas Gleixner
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.
Quoted 8 lines
Prevent executing the hotplug callbacks when
cpuhp_tasks_frozenis true.Thanks to Tommi for providing debug information patiently while I failed to spot the obvious.
Fixes e00ca5df37ad ("hwmon: (coretemp) Convert to hotplug state machine")Reported-by Tommi Rantala <[email protected]>Signed-off-by Thomas Gleixner <[email protected]>
Applied, and thanks a lot for fixing the problem!
Guenter
Quoted 38 lines
--- drivers/hwmon/coretemp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/hwmon/coretemp.c +14
-1@@ -605,6 +605,13 @@ static int coretemp_cpu_online(unsignedstruct 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 * sensors. We check this bit only, all the early CPUs * without thermal sensors will be filtered out. @@ -654,6 +661,13 @@ static int coretemp_cpu_offline(unsignedstruct temp_data *tdata;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 (!pdev)return 0 ; --To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html