]> www.infradead.org Git - users/dwmw2/linux.git/commit
panic: Flush kernel log buffer at the end
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 7 Feb 2024 13:41:02 +0000 (14:47 +0106)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 11:01:43 +0000 (13:01 +0200)
commitf4e70f422b764a48e198c3096371a8066c47b49e
treeccdade97a45a77b1407cc56987fef5eb04ed0abb
parent130b0cd064874e0d0f58e18fb00e6f3993e90c74
panic: Flush kernel log buffer at the end

[ Upstream commit d988d9a9b9d180bfd5c1d353b3b176cb90d6861b ]

If the kernel crashes in a context where printk() calls always
defer printing (such as in NMI or inside a printk_safe section)
then the final panic messages will be deferred to irq_work. But
if irq_work is not available, the messages will not get printed
unless explicitly flushed. The result is that the final
"end Kernel panic" banner does not get printed.

Add one final flush after the last printk() call to make sure
the final panic messages make it out as well.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240207134103.1357162-14-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/panic.c