summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-05-24 12:37:34 +0300
committerAvi Kivity <avi@qumranet.com>2007-07-16 12:05:50 +0300
commit38ef6d195fb794e61a687ef8f5a37daf6044d576 (patch)
tree2657613a658dfc194fb960623e7d7a69d1d41aae /arch
parentac076758b97d9e3d2c1557cfa412911e93cd0919 (diff)
downloadkernel-crypto-38ef6d195fb794e61a687ef8f5a37daf6044d576.tar.gz
kernel-crypto-38ef6d195fb794e61a687ef8f5a37daf6044d576.tar.xz
kernel-crypto-38ef6d195fb794e61a687ef8f5a37daf6044d576.zip
HOTPLUG: Adapt thermal throttle to CPU_DYING
CPU_DYING is notified in atomic context, so no taking mutexes here. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/cpu/mcheck/therm_throt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/i386/kernel/cpu/mcheck/therm_throt.c
index 7ba7c3abd3a..1203dc5ab87 100644
--- a/arch/i386/kernel/cpu/mcheck/therm_throt.c
+++ b/arch/i386/kernel/cpu/mcheck/therm_throt.c
@@ -134,19 +134,21 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb,
int err;
sys_dev = get_cpu_sysdev(cpu);
- mutex_lock(&therm_cpu_lock);
switch (action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
+ mutex_lock(&therm_cpu_lock);
err = thermal_throttle_add_dev(sys_dev);
+ mutex_unlock(&therm_cpu_lock);
WARN_ON(err);
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
+ mutex_lock(&therm_cpu_lock);
thermal_throttle_remove_dev(sys_dev);
+ mutex_unlock(&therm_cpu_lock);
break;
}
- mutex_unlock(&therm_cpu_lock);
return NOTIFY_OK;
}