From: Rafael J. Wysocki Date: Mon, 3 Dec 2007 17:01:50 +0000 (+0100) Subject: HWMON: coretemp, suspend fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=561d9a969455cb009bb15b63e1d925dc527e7a9d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Acked-by: Mark M. Hoffman Cc: Jiri Slaby Cc: Andrew Morton Signed-off-by: Len Brown --- 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, switch (action) { case CPU_ONLINE: - case CPU_ONLINE_FROZEN: + case CPU_DOWN_FAILED: coretemp_device_add(cpu); break; - case CPU_DEAD: - case CPU_DEAD_FROZEN: + case CPU_DOWN_PREPARE: coretemp_device_remove(cpu); break; }