]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
HOTPLUG: Adapt thermal throttle to CPU_DYING
authorAvi Kivity <avi@qumranet.com>
Thu, 24 May 2007 09:37:34 +0000 (12:37 +0300)
committerAvi Kivity <avi@qumranet.com>
Mon, 16 Jul 2007 09:05:50 +0000 (12:05 +0300)
CPU_DYING is notified in atomic context, so no taking mutexes here.

Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/i386/kernel/cpu/mcheck/therm_throt.c

index 7ba7c3abd3a4a74866899b7d6d6cae38f3113b93..1203dc5ab87aa36ec2042ed8249c76892be1b20c 100644 (file)
@@ -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;
 }