]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: 8808/1: kexec:offline panic_smp_self_stop CPU
authorYufen Wang <wangyufen@huawei.com>
Fri, 2 Nov 2018 10:51:31 +0000 (11:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Feb 2019 09:08:55 +0000 (10:08 +0100)
commita160cf4ee87a8f5a14c6814dacf408ee4499a514
tree0e7d4c287af56834f64d0f566f9e35cf33569d89
parenta3d19b2bb4300515ef6c884482635e0f835339ba
ARM: 8808/1: kexec:offline panic_smp_self_stop CPU

[ Upstream commit 82c08c3e7f171aa7f579b231d0abbc1d62e91974 ]

In case panic() and panic() called at the same time on different CPUS.
For example:
CPU 0:
  panic()
     __crash_kexec
       machine_crash_shutdown
         crash_smp_send_stop
       machine_kexec
         BUG_ON(num_online_cpus() > 1);

CPU 1:
  panic()
    local_irq_disable
    panic_smp_self_stop

If CPU 1 calls panic_smp_self_stop() before crash_smp_send_stop(), kdump
fails. CPU1 can't receive the ipi irq, CPU1 will be always online.
To fix this problem, this patch split out the panic_smp_self_stop()
and add set_cpu_online(smp_processor_id(), false).

Signed-off-by: Yufen Wang <wangyufen@huawei.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/kernel/smp.c