powerpc/smp: Fix generic_mach_cpu_die()
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Thu, 10 Feb 2011 07:46:50 +0000 (18:46 +1100)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 1 Apr 2011 04:37:10 +0000 (15:37 +1100)
This is used by some "soft" hotplug implementations. I needs to
call idle_task_exit() when the CPU is going away, and we remove
the now no-longer needed set_cpu_online() and local_irq_enable()
which are handled by the return to start_secondary

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/smp.c

index 1c9956c438019ee4da6f2a1fc9ddc7c52c4ae9a6..3c0fab5e1e16c033f15928eae5217da0e30e6931 100644 (file)
@@ -362,14 +362,13 @@ void generic_mach_cpu_die(void)
        unsigned int cpu;
 
        local_irq_disable();
+       idle_task_exit();
        cpu = smp_processor_id();
        printk(KERN_DEBUG "CPU%d offline\n", cpu);
        __get_cpu_var(cpu_state) = CPU_DEAD;
        smp_wmb();
        while (__get_cpu_var(cpu_state) != CPU_UP_PREPARE)
                cpu_relax();
-       set_cpu_online(cpu, true);
-       local_irq_enable();
 }
 #endif