]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
printk: Flush nbcon consoles first on panic
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 20 Aug 2024 06:29:51 +0000 (08:35 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 21 Aug 2024 12:56:24 +0000 (14:56 +0200)
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>
Link: https://lore.kernel.org/r/20240820063001.36405-26-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
kernel/printk/printk.c

index 7c9f8f6e173877c7fb6686dc2237f71e97235b5b..c6e633329e4d5cdd608bba0d7f505285bc6de40b 100644 (file)
@@ -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);
 }