MIPS: smp: Make stop_this_cpu() actually stop the CPU
authorAndrew Bresticker <abrestic@chromium.org>
Wed, 25 Mar 2015 17:25:43 +0000 (10:25 -0700)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 1 Apr 2015 15:21:58 +0000 (17:21 +0200)
Since cpu_wait() enables interrupts upon return, CPUs which have
entered stop_this_cpu() may still end up handling interrupts.
This can lead to the softlockup detector firing on a panic or
restart/poweroff/halt.  Just disable interrupts and spin to ensure
nothing else runs on the CPU once it has entered stop_this_cpu().

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/9601/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/smp.c

index 1c0d8c50b7e120482e7891c82653e49a5b63a953..5b020bda3e05763476a0001a79a606659de95714 100644 (file)
@@ -176,10 +176,8 @@ static void stop_this_cpu(void *dummy)
         * Remove this CPU:
         */
        set_cpu_online(smp_processor_id(), false);
-       for (;;) {
-               if (cpu_wait)
-                       (*cpu_wait)();          /* Wait if available. */
-       }
+       local_irq_disable();
+       while (1);
 }
 
 void smp_send_stop(void)