diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2007-10-18 06:05:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-18 17:37:21 -0400 |
commit | c7e38a9c27ced4020d64749400cece4fbad4679e (patch) | |
tree | c7ee053bdb4274b2045d174102472dec1d3038d8 /arch | |
parent | 9780e3e968537db0ac8d5b4857bb38bc40217c01 (diff) |
cpu hotplug: thermal_throttle: fix cpu hotplug error handling
Do thermal_throttle_add_dev() in CPU_UP_PREPARE instead of CPU_ONLINE.
Cc: Dmitriy Zavin <dmitriyz@google.com>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Gautham R Shenoy <ego@in.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andi Kleen <ak@suse.de>
Cc: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 494d320d909b..24885be5c48c 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -131,17 +131,19 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb, | |||
131 | { | 131 | { |
132 | unsigned int cpu = (unsigned long)hcpu; | 132 | unsigned int cpu = (unsigned long)hcpu; |
133 | struct sys_device *sys_dev; | 133 | struct sys_device *sys_dev; |
134 | int err; | 134 | int err = 0; |
135 | 135 | ||
136 | sys_dev = get_cpu_sysdev(cpu); | 136 | sys_dev = get_cpu_sysdev(cpu); |
137 | switch (action) { | 137 | switch (action) { |
138 | case CPU_ONLINE: | 138 | case CPU_UP_PREPARE: |
139 | case CPU_ONLINE_FROZEN: | 139 | case CPU_UP_PREPARE_FROZEN: |
140 | mutex_lock(&therm_cpu_lock); | 140 | mutex_lock(&therm_cpu_lock); |
141 | err = thermal_throttle_add_dev(sys_dev); | 141 | err = thermal_throttle_add_dev(sys_dev); |
142 | mutex_unlock(&therm_cpu_lock); | 142 | mutex_unlock(&therm_cpu_lock); |
143 | WARN_ON(err); | 143 | WARN_ON(err); |
144 | break; | 144 | break; |
145 | case CPU_UP_CANCELED: | ||
146 | case CPU_UP_CANCELED_FROZEN: | ||
145 | case CPU_DEAD: | 147 | case CPU_DEAD: |
146 | case CPU_DEAD_FROZEN: | 148 | case CPU_DEAD_FROZEN: |
147 | mutex_lock(&therm_cpu_lock); | 149 | mutex_lock(&therm_cpu_lock); |
@@ -149,7 +151,7 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb, | |||
149 | mutex_unlock(&therm_cpu_lock); | 151 | mutex_unlock(&therm_cpu_lock); |
150 | break; | 152 | break; |
151 | } | 153 | } |
152 | return NOTIFY_OK; | 154 | return err ? NOTIFY_BAD : NOTIFY_OK; |
153 | } | 155 | } |
154 | 156 | ||
155 | static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata = | 157 | static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata = |