]> www.infradead.org Git - users/dwmw2/linux.git/commit
printk: Coordinate direct printing in panic
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 20 Aug 2024 06:29:55 +0000 (08:35 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 21 Aug 2024 12:56:25 +0000 (14:56 +0200)
commite35a8884270bae11196eedf3b0a5bf22619f11f2
treecc81a846c28d8dea1f67f0c7ab275756d09d12d6
parentbebd87ae27e052e390c203893c7ee46f54b0bf9e
printk: Coordinate direct printing in panic

If legacy and nbcon consoles are registered and the nbcon
consoles are allowed to flush (i.e. no boot consoles
registered), the legacy consoles will no longer perform
direct printing on the panic CPU until after the backtrace
has been stored. This will give the safe nbcon consoles a
chance to print the panic messages before allowing the
unsafe legacy consoles to print.

If no nbcon consoles are registered or they are not allowed
to flush because boot consoles are registered, there is no
change in behavior (i.e. legacy consoles will always attempt
to print from the printk() caller context).

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240820063001.36405-30-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
include/linux/printk.h
kernel/panic.c
kernel/printk/internal.h
kernel/printk/printk.c