aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/cpu.c
diff options
context:
space:
mode:
authorAshok Raj <ashok.raj@intel.com>2006-03-25 06:08:18 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:23:01 -0500
commit34f361ade2fb4a869f6a7714d01c04ce4cfa75d9 (patch)
treea250999fc386ddbfe3c92e4d8ffdcf2d3393134a /drivers/base/cpu.c
parentf1a1c2dc2a956c375b432d2a9a28e52ba9d81c7c (diff)
[PATCH] Check if cpu can be onlined before calling smp_prepare_cpu()
- Moved check for online cpu out of smp_prepare_cpu() - Moved default declaration of smp_prepare_cpu() to kernel/cpu.c - Removed lock_cpu_hotplug() from smp_prepare_cpu() to around it, since its called from cpu_up() as well now. - Removed clearing from cpu_present_map during cpu_offline as it breaks using cpu_up() directly during a subsequent online operation. Signed-off-by: Ashok Raj <ashok.raj@intel.com> Cc: Srivatsa Vaddagiri <vatsa@in.ibm.com> Cc: "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/base/cpu.c')
-rw-r--r--drivers/base/cpu.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 29f3d7504da1..dd712b24ec91 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -19,11 +19,6 @@ EXPORT_SYMBOL(cpu_sysdev_class);
19static struct sys_device *cpu_sys_devices[NR_CPUS]; 19static struct sys_device *cpu_sys_devices[NR_CPUS];
20 20
21#ifdef CONFIG_HOTPLUG_CPU 21#ifdef CONFIG_HOTPLUG_CPU
22int __attribute__((weak)) smp_prepare_cpu (int cpu)
23{
24 return 0;
25}
26
27static ssize_t show_online(struct sys_device *dev, char *buf) 22static ssize_t show_online(struct sys_device *dev, char *buf)
28{ 23{
29 struct cpu *cpu = container_of(dev, struct cpu, sysdev); 24 struct cpu *cpu = container_of(dev, struct cpu, sysdev);
@@ -44,9 +39,7 @@ static ssize_t store_online(struct sys_device *dev, const char *buf,
44 kobject_uevent(&dev->kobj, KOBJ_OFFLINE); 39 kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
45 break; 40 break;
46 case '1': 41 case '1':
47 ret = smp_prepare_cpu(cpu->sysdev.id); 42 ret = cpu_up(cpu->sysdev.id);
48 if (!ret)
49 ret = cpu_up(cpu->sysdev.id);
50 if (!ret) 43 if (!ret)
51 kobject_uevent(&dev->kobj, KOBJ_ONLINE); 44 kobject_uevent(&dev->kobj, KOBJ_ONLINE);
52 break; 45 break;