[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>
This commit is contained in:
Li Shaohua
2005-06-25 14:54:56 -07:00
committed by Linus Torvalds
parent 0bb3184df5
commit e1367daf3e
7 changed files with 186 additions and 42 deletions

View File

@@ -16,6 +16,10 @@ struct sysdev_class cpu_sysdev_class = {
EXPORT_SYMBOL(cpu_sysdev_class);
#ifdef CONFIG_HOTPLUG_CPU
#ifndef __HAVE_ARCH_SMP_PREPARE_CPU
#define smp_prepare_cpu(cpu) (0)
#endif
static ssize_t show_online(struct sys_device *dev, char *buf)
{
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,
kobject_hotplug(&dev->kobj, KOBJ_OFFLINE);
break;
case '1':
ret = cpu_up(cpu->sysdev.id);
ret = smp_prepare_cpu(cpu->sysdev.id);
if (ret == 0)
ret = cpu_up(cpu->sysdev.id);
break;
default:
ret = -EINVAL;