aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-12-03 12:01:50 -0500
committerLen Brown <len.brown@intel.com>2007-12-04 01:35:32 -0500
commit561d9a969455cb009bb15b63e1d925dc527e7a9d (patch)
treec5465a27338ef4ca6cf0b554e86d0f2a880815d7
parent09b56adc98e0f8a21644fcb4d20ad367c3fceb55 (diff)
HWMON: coretemp, suspend fix
It's not permitted to unregister a device after devices have been suspended. It causes deadlocks to appear on systems with coretemp hwmon loaded.  To avoid this, we can make coretemp_cpu_callback() do nothing if the _FROZEN bit is set in action.   Also, in other cases it's generally too late to unregister the coretemp device if the CPU is already dead, so it should be unregistered on CPU_DOWN_PREPARE.   Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Mark M. Hoffman <mhoffman@lightlink.com> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r--drivers/hwmon/coretemp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 5c82ec7f8bbd..3ee60d26e3a2 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -337,11 +337,10 @@ static int coretemp_cpu_callback(struct notifier_block *nfb,
337 337
338 switch (action) { 338 switch (action) {
339 case CPU_ONLINE: 339 case CPU_ONLINE:
340 case CPU_ONLINE_FROZEN: 340 case CPU_DOWN_FAILED:
341 coretemp_device_add(cpu); 341 coretemp_device_add(cpu);
342 break; 342 break;
343 case CPU_DEAD: 343 case CPU_DOWN_PREPARE:
344 case CPU_DEAD_FROZEN:
345 coretemp_device_remove(cpu); 344 coretemp_device_remove(cpu);
346 break; 345 break;
347 } 346 }