From 234c7f1ac109ad1af4ae410463d03ccebf3d6657 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Fri, 28 Jun 2013 13:56:02 +0100 Subject: metag: smp: enable irqs after set_cpu_online 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 Signed-off-by: James Hogan Acked-by: Thomas Gleixner Reviewed-by: "Srivatsa S. Bhat" Cc: Kirill Tkhai diff --git a/arch/metag/kernel/smp.c b/arch/metag/kernel/smp.c index b813515..09979f2 100644 --- a/arch/metag/kernel/smp.c +++ b/arch/metag/kernel/smp.c @@ -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]); @@ -398,6 +393,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 */ cpu_startup_entry(CPUHP_ONLINE); -- cgit v0.10.2