Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: smp: Make stop_this_cpu() actually stop the CPU

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>

authored by

Andrew Bresticker and committed by
Ralf Baechle
ea925a72 c1bed31f

+2 -4
+2 -4
arch/mips/kernel/smp.c
··· 176 176 * Remove this CPU: 177 177 */ 178 178 set_cpu_online(smp_processor_id(), false); 179 - for (;;) { 180 - if (cpu_wait) 181 - (*cpu_wait)(); /* Wait if available. */ 182 - } 179 + local_irq_disable(); 180 + while (1); 183 181 } 184 182 185 183 void smp_send_stop(void)