[PATCH printk v7 25/35] printk: Flush nbcon consoles first on panic

John Ogness posted 35 patches 1 year, 4 months ago
There is a newer version of this series
[PATCH printk v7 25/35] printk: Flush nbcon consoles first on panic
Posted by John Ogness 1 year, 4 months ago
In console_flush_on_panic(), flush the nbcon consoles before
flushing legacy consoles. The legacy write() callbacks are not
fully safe when oops_in_progress is set.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 kernel/printk/printk.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index d54eae0d06e9..f61ecb84c3f6 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3269,6 +3269,9 @@ void console_flush_on_panic(enum con_flush_mode mode)
 	if (mode == CONSOLE_REPLAY_ALL)
 		__console_rewind_all();
 
+	if (!have_boot_console)
+		nbcon_atomic_flush_pending();
+
 	console_flush_all(false, &next_seq, &handover);
 }
 
-- 
2.39.2
Re: [PATCH printk v7 25/35] printk: Flush nbcon consoles first on panic
Posted by Petr Mladek 1 year, 4 months ago
On Sun 2024-08-04 02:57:28, John Ogness wrote:
> In console_flush_on_panic(), flush the nbcon consoles before
> flushing legacy consoles. The legacy write() callbacks are not
> fully safe when oops_in_progress is set.
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr