]> git.karo-electronics.de Git - linux-beck.git/commitdiff
metag: smp: enable irqs after set_cpu_online
authorJames Hogan <james.hogan@imgtec.com>
Fri, 28 Jun 2013 12:56:02 +0000 (13:56 +0100)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 2 Jul 2013 10:03:51 +0000 (11:03 +0100)
In secondary_start_kernel() interrupts should be enabled with
local_irq_enable() after the cpu is marked as online with
set_cpu_online(). Otherwise it's possible for a timer interrupt to
trigger a softirq, which if the cpu is marked as offline may have it's
affinity altered.

Reported-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Kirill Tkhai <tkhai@yandex.ru>
arch/metag/kernel/smp.c

index b81351538c487d388717802ddba8f49022b07931..09979f203a4d1b85018ccdec0cb05607be048b9a 100644 (file)
@@ -379,12 +379,7 @@ asmlinkage void secondary_start_kernel(void)
 
        setup_priv();
 
-       /*
-        * Enable local interrupts.
-        */
-       tbi_startup_interrupt(TBID_SIGNUM_TRT);
        notify_cpu_starting(cpu);
-       local_irq_enable();
 
        pr_info("CPU%u (thread %u): Booted secondary processor\n",
                cpu, cpu_2_hwthread_id[cpu]);
@@ -397,6 +392,12 @@ asmlinkage void secondary_start_kernel(void)
         */
        set_cpu_online(cpu, true);
 
+       /*
+        * Enable local interrupts.
+        */
+       tbi_startup_interrupt(TBID_SIGNUM_TRT);
+       local_irq_enable();
+
        /*
         * OK, it's off to the idle thread for us
         */