Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git...
[pandora-kernel.git] / arch / arm / kernel / smp.c
index a96c08c..ef5640b 100644 (file)
@@ -319,17 +319,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
         */
        platform_secondary_init(cpu);
 
-       /*
-        * Enable local interrupts.
-        */
        notify_cpu_starting(cpu);
-       local_irq_enable();
-       local_fiq_enable();
-
-       /*
-        * Setup the percpu timer for this CPU.
-        */
-       percpu_timer_setup();
 
        calibrate_delay();
 
@@ -341,9 +331,22 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
         * before we continue.
         */
        set_cpu_online(cpu, true);
+
+       /*
+        * Setup the percpu timer for this CPU.
+        */
+       percpu_timer_setup();
+
        while (!cpu_active(cpu))
                cpu_relax();
 
+       /*
+        * cpu_active bit is set, so it's safe to enalbe interrupts
+        * now.
+        */
+       local_irq_enable();
+       local_fiq_enable();
+
        /*
         * OK, it's off to the idle thread for us
         */
@@ -527,7 +530,7 @@ static void percpu_timer_stop(void)
 }
 #endif
 
-static DEFINE_SPINLOCK(stop_lock);
+static DEFINE_RAW_SPINLOCK(stop_lock);
 
 /*
  * ipi_cpu_stop - handle IPI from smp_send_stop()
@@ -536,10 +539,10 @@ static void ipi_cpu_stop(unsigned int cpu)
 {
        if (system_state == SYSTEM_BOOTING ||
            system_state == SYSTEM_RUNNING) {
-               spin_lock(&stop_lock);
+               raw_spin_lock(&stop_lock);
                printk(KERN_CRIT "CPU%u: stopping\n", cpu);
                dump_stack();
-               spin_unlock(&stop_lock);
+               raw_spin_unlock(&stop_lock);
        }
 
        set_cpu_online(cpu, false);