summaryrefslogtreecommitdiff
path: root/arch/powerpc/kexec
diff options
context:
space:
mode:
authorLeonardo Bras <leobras.c@gmail.com>2020-05-12 18:45:35 -0300
committerMichael Ellerman <mpe@ellerman.id.au>2020-06-02 20:59:07 +1000
commitaf2876b501e42c3fb5174cac9dd02598436f0fdf (patch)
tree4ec069414fb9c0383185ebc4fb9cf59b81857878 /arch/powerpc/kexec
parentb6eca183e23e7a6625a0d2cdb806b7cd1abcd2d2 (diff)
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
Diffstat (limited to 'arch/powerpc/kexec')
-rw-r--r--arch/powerpc/kexec/crash.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kexec/crash.c b/arch/powerpc/kexec/crash.c
index d488311efab1..c9a889880214 100644
--- a/arch/powerpc/kexec/crash.c
+++ b/arch/powerpc/kexec/crash.c
@@ -311,6 +311,9 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
unsigned int i;
int (*old_handler)(struct pt_regs *regs);
+ /* Avoid hardlocking with irresponsive CPU holding logbuf_lock */
+ printk_nmi_enter();
+
/*
* This function is only called after the system
* has panicked or is otherwise in a critical state.