]> Gentwo Git Trees - linux/.git/commit
kdb: Adapt kdb_msg_write to work with NBCON consoles
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Thu, 16 Oct 2025 14:47:58 +0000 (11:47 -0300)
committerPetr Mladek <pmladek@suse.com>
Fri, 24 Oct 2025 10:56:20 +0000 (12:56 +0200)
commit62627bf0cadf6eae87d92fecf604c42160fe16ef
tree6aea4d6718afbadb8f10251739fe31dc14a170ba
parent4349cf0df34f37d2470d246bc9be8d9836dfa49e
kdb: Adapt kdb_msg_write to work with NBCON consoles

Function kdb_msg_write was calling con->write for any found console,
but it won't work on NBCON consoles. In this case we should acquire the
ownership of the console using NBCON_PRIO_EMERGENCY, since printing
kdb messages should only be interrupted by a panic.

At this point, the console is required to use the atomic callback. The
console is skipped if the write_atomic callback is not set or if the
context could not be acquired. The validation of NBCON is done by the
console_is_usable helper. The context is released right after
write_atomic finishes.

The oops_in_progress handling is only needed in the legacy consoles,
so it was moved around the con->write callback.

Suggested-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Link: https://patch.msgid.link/20251016-nbcon-kgdboc-v6-5-866aac60a80e@suse.com
[pmladek@suse.com: Fixed compilation with !CONFIG_PRINTK.]
Signed-off-by: Petr Mladek <pmladek@suse.com>
include/linux/console.h
kernel/debug/kdb/kdb_io.c