]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Fix deadlock with multiple calls to smp_send_stop
authorNicholas Piggin <npiggin@gmail.com>
Fri, 27 Apr 2018 01:51:59 +0000 (11:51 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 27 Apr 2018 06:35:57 +0000 (16:35 +1000)
commit3509e8311f7615b1a59ef6060f0b1d98ce89bd73
tree912e2106089759f15a24f1e2f5bf384946c42878
parent9b656d19f15df742ccc88ed0875874a62c3f2168
powerpc: Fix deadlock with multiple calls to smp_send_stop

smp_send_stop can lock up the IPI path for any subsequent calls,
because the receiving CPUs spin in their handler function. This
started becoming a problem with the addition of an smp_send_stop
call in the reboot path, because panics can reboot after doing
their own smp_send_stop.

The NMI IPI variant was fixed with ebc2aa86fd ("powerpc: Fix
smp_send_stop NMI IPI handling"), which leaves the smp_call_function
variant.

This is fixed by having smp_send_stop only ever do the
smp_call_function once. This is a bit less robust than the NMI IPI
fix, because any other call to smp_call_function after smp_send_stop
could deadlock, but that has always been the case, and it was not
been a problem before.

Fixes: 3d3efcdda2a79 ("powerpc/powernv: Always stop secondaries before reboot/shutdown")
Reported-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/smp.c