Merge branch 'master' of ../mmc
[pandora-kernel.git] / arch / powerpc / platforms / pseries / hotplug-cpu.c
index fc48b96..a20ead8 100644 (file)
@@ -29,6 +29,7 @@
 #include <asm/vdso_datapage.h>
 #include <asm/pSeries_reconfig.h>
 #include "xics.h"
+#include "plpar_wrappers.h"
 
 /* This version can't take the spinlock, because it never returns */
 static struct rtas_args rtas_stop_self_args = {
@@ -57,7 +58,8 @@ static void pseries_mach_cpu_die(void)
 {
        local_irq_disable();
        idle_task_exit();
-       xics_teardown_cpu(0);
+       xics_teardown_cpu();
+       unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow()));
        rtas_stop_self();
        /* Should never get here... */
        BUG();
@@ -114,7 +116,7 @@ static void pseries_cpu_die(unsigned int cpu)
                cpu_status = query_cpu_stopped(pcpu);
                if (cpu_status == 0 || cpu_status == -1)
                        break;
-               msleep(200);
+               cpu_relax();
        }
        if (cpu_status != 0) {
                printk("Querying DEAD? cpu %i (%i) shows %i\n",
@@ -151,7 +153,7 @@ static int pseries_add_processor(struct device_node *np)
        for (i = 0; i < nthreads; i++)
                cpu_set(i, tmp);
 
-       lock_cpu_hotplug();
+       cpu_maps_update_begin();
 
        BUG_ON(!cpus_subset(cpu_present_map, cpu_possible_map));
 
@@ -188,7 +190,7 @@ static int pseries_add_processor(struct device_node *np)
        }
        err = 0;
 out_unlock:
-       unlock_cpu_hotplug();
+       cpu_maps_update_done();
        return err;
 }
 
@@ -209,7 +211,7 @@ static void pseries_remove_processor(struct device_node *np)
 
        nthreads = len / sizeof(u32);
 
-       lock_cpu_hotplug();
+       cpu_maps_update_begin();
        for (i = 0; i < nthreads; i++) {
                for_each_present_cpu(cpu) {
                        if (get_hard_smp_processor_id(cpu) != intserv[i])
@@ -223,7 +225,7 @@ static void pseries_remove_processor(struct device_node *np)
                        printk(KERN_WARNING "Could not find cpu to remove "
                               "with physical id 0x%x\n", intserv[i]);
        }
-       unlock_cpu_hotplug();
+       cpu_maps_update_done();
 }
 
 static int pseries_smp_notifier(struct notifier_block *nb,