diff mbox series

[2/2] reboot: flush printk buffers before final shutdown

Message ID a64dd2c6829f07caae9e93c37d5a2bcfc3dbd6e9.1712051763.git.esben@geanix.com
State New
Headers show
Series [1/2] printk: export pr_flush() | expand

Commit Message

Esben Haabendal April 2, 2024, 10:13 a.m. UTC
From: Martin Hundebøll <martin@geanix.com>

Make sure printed messages are in fact printed before putting the system
down.

Signed-off-by: Martin Hundebøll <martin@geanix.com>
---
 kernel/reboot.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/kernel/reboot.c b/kernel/reboot.c
index 22c16e2564cc..e3fa5613257f 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -283,6 +283,7 @@  void kernel_restart(char *cmd)
 	else
 		pr_emerg("Restarting system with command '%s'\n", cmd);
 	kmsg_dump(KMSG_DUMP_SHUTDOWN);
+	pr_flush(1000, false);
 	machine_restart(cmd);
 }
 EXPORT_SYMBOL_GPL(kernel_restart);