arm64: Only enable local interrupts after the CPU is marked online
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 19 Jul 2013 14:08:15 +0000 (15:08 +0100)
committerMark Brown <broonie@linaro.org>
Wed, 14 May 2014 11:16:21 +0000 (12:16 +0100)
commit 53ae3acd4390ffeecb3a11dbd5be347b5a3d98f2 upstream.

There is a slight chance that (timer) interrupts are triggered before a
secondary CPU has been marked online with implications on softirq thread
affinity.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Kirill Tkhai <tkhai@yandex.ru>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 81ca15a3e04961b54d4a0b395e681bffb6cfbc68)
Signed-off-by: Mark Brown <broonie@linaro.org>
arch/arm64/kernel/smp.c

index 5d54e3717bf81a54eedac2aabf0790745be85fd7..9c93e126328cfaa04ffdaa8612a43e4d9d09a6aa 100644 (file)
@@ -199,13 +199,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
        raw_spin_lock(&boot_lock);
        raw_spin_unlock(&boot_lock);
 
-       /*
-        * Enable local interrupts.
-        */
-       notify_cpu_starting(cpu);
-       local_irq_enable();
-       local_fiq_enable();
-
        /*
         * OK, now it's safe to let the boot CPU continue.  Wait for
         * the CPU migration code to notice that the CPU is online
@@ -214,6 +207,14 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
        set_cpu_online(cpu, true);
        complete(&cpu_running);
 
+       /*
+        * Enable GIC and timers.
+        */
+       notify_cpu_starting(cpu);
+
+       local_irq_enable();
+       local_fiq_enable();
+
        /*
         * OK, it's off to the idle thread for us
         */