diff --git a/kernel/panic.c b/kernel/panic.c index 47933d4c769b..3b14c6d123dd 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -425,6 +425,14 @@ void panic(const char *fmt, ...) /* Do not scroll important messages printed above */ suppress_printk = 1; + + /* + * The final messages may not have been printed if in a context that + * defers printing (such as NMI) and irq_work is not available. + * Explicitly flush the kernel log buffer one last time. + */ + console_flush_on_panic(CONSOLE_FLUSH_PENDING); + local_irq_enable(); for (i = 0; ; i += PANIC_TIMER_STEP) { touch_softlockup_watchdog();