]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
powerpc: Fix deadlock with multiple calls to smp_send_stop
authorNicholas Piggin <npiggin@gmail.com>
Wed, 5 Sep 2018 16:17:00 +0000 (18:17 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Thu, 6 Sep 2018 07:24:56 +0000 (09:24 +0200)
commit960ebe121133b14a07ddfa1579374257b0c26521
tree4d12725db58017796fcae6b934aaf60e8c657f1c
parentdee7016d22cd3dcb4d340db0ba41add7c179ca11
powerpc: Fix deadlock with multiple calls to smp_send_stop

BugLink: http://bugs.launchpad.net/bugs/1790636
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 ac61c11566 ("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: f2748bdfe1573 ("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>
(cherry picked from commit 6029755eed95e5c90f763188c87ae3ff41e48e5c)
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Acked-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Khalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/powerpc/kernel/smp.c