mirror-linux/kernel/debug/kdb
Marcos Paulo de Souza 62627bf0ca 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>
2025-10-24 12:56:20 +02:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile
kdb_bp.c kdb: Fix breakpoint enable to be silent if already enabled 2024-11-02 08:41:39 +00:00
kdb_bt.c kdb: Get rid of redundant kdb_curr_task() 2024-06-21 15:49:29 +01:00
kdb_cmds
kdb_debugger.c kdb: Get rid of custom debug heap allocator 2021-07-27 14:46:11 +01:00
kdb_io.c kdb: Adapt kdb_msg_write to work with NBCON consoles 2025-10-24 12:56:20 +02:00
kdb_keyboard.c kdb: remove redundant check for scancode 0xe0 2025-09-20 21:19:09 +01:00
kdb_main.c kdb: Replace deprecated strcpy() with helper function in kdb_defcmd() 2025-09-20 19:56:28 +01:00
kdb_private.h kdb: Replace deprecated strcpy() with helper function in kdb_defcmd() 2025-09-20 19:56:28 +01:00
kdb_support.c kdb: Replace deprecated strcpy() with helper function in kdb_defcmd() 2025-09-20 19:56:28 +01:00