aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLi Shaohua <shaohua.li@intel.com>2005-06-25 17:54:56 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-25 19:24:30 -0400
commite1367daf3eed5cd619ee88c9907e1e6ddaa58406 (patch)
treedce60efefba356e0a914669587586a6174e41b94 /drivers
parent0bb3184df537002a742bafddf3f4fb482b7fe610 (diff)
[PATCH] cpu state clean after hot remove
Clean CPU states in order to reuse smp boot code for CPU hotplug. Signed-off-by: Li Shaohua<shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/cpu.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 6ef3069b5710..bdd7e9f55c81 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -16,6 +16,10 @@ struct sysdev_class cpu_sysdev_class = {
16EXPORT_SYMBOL(cpu_sysdev_class); 16EXPORT_SYMBOL(cpu_sysdev_class);
17 17
18#ifdef CONFIG_HOTPLUG_CPU 18#ifdef CONFIG_HOTPLUG_CPU
19#ifndef __HAVE_ARCH_SMP_PREPARE_CPU
20#define smp_prepare_cpu(cpu) (0)
21#endif
22
19static ssize_t show_online(struct sys_device *dev, char *buf) 23static ssize_t show_online(struct sys_device *dev, char *buf)
20{ 24{
21 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 25 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -36,7 +40,9 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
36 kobject_hotplug(&dev->kobj, KOBJ_OFFLINE); 40 kobject_hotplug(&dev->kobj, KOBJ_OFFLINE);
37 break; 41 break;
38 case '1': 42 case '1':
39 ret = cpu_up(cpu->sysdev.id); 43 ret = smp_prepare_cpu(cpu->sysdev.id);
44 if (ret == 0)
45 ret = cpu_up(cpu->sysdev.id);
40 break; 46 break;
41 default: 47 default:
42 ret = -EINVAL; 48 ret = -EINVAL;