xtensa: Enable irqs after cpu is set online
authorKirill Tkhai <tkhai@yandex.ru>
Thu, 12 Dec 2013 13:41:01 +0000 (17:41 +0400)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 14 Jan 2014 20:12:41 +0000 (00:12 +0400)
there is a small possibility that wake_up of softirq thread
happens between local_irq_enable() and set_cpu_online(). In
this case affinity of the thread changes to fallback affinity
(i.e. CPU0). This may be a source of problems.

The patch kills that possibility.

Signed-off-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/kernel/smp.c

index 1c7a209795e85d6b5f97a2bc6325124275abc2d2..aa8bd8717927185bd5b422316885ddaa98d889f7 100644 (file)
@@ -151,9 +151,10 @@ void secondary_start_kernel(void)
        secondary_init_irq();
        local_timer_setup(cpu);
 
+       set_cpu_online(cpu, true);
+
        local_irq_enable();
 
-       set_cpu_online(cpu, true);
        complete(&cpu_running);
 
        cpu_startup_entry(CPUHP_ONLINE);