OSDN Git Service

powerpc/crash: Use NMI context for printk when starting to crash
authorLeonardo Bras <leobras.c@gmail.com>
Tue, 12 May 2020 21:45:35 +0000 (18:45 -0300)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 2 Jun 2020 10:59:07 +0000 (20:59 +1000)
commitaf2876b501e42c3fb5174cac9dd02598436f0fdf
tree4ec069414fb9c0383185ebc4fb9cf59b81857878
parentb6eca183e23e7a6625a0d2cdb806b7cd1abcd2d2
powerpc/crash: Use NMI context for printk when starting to crash

Currently, if printk lock (logbuf_lock) is held by other thread during
crash, there is a chance of deadlocking the crash on next printk, and
blocking a possibly desired kdump.

At the start of default_machine_crash_shutdown, make printk enter
NMI context, as it will use per-cpu buffers to store the message,
and avoid locking logbuf_lock.

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Leonardo Bras <leobras.c@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200512214533.93878-1-leobras.c@gmail.com
arch/powerpc/kexec/crash.c