summaryrefslogtreecommitdiff
path: root/include/linux/console.h
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <mpdesouza@suse.com>2025-10-16 11:47:58 -0300
committerPetr Mladek <pmladek@suse.com>2025-10-24 12:56:20 +0200
commit62627bf0cadf6eae87d92fecf604c42160fe16ef (patch)
tree6aea4d6718afbadb8f10251739fe31dc14a170ba /include/linux/console.h
parent4349cf0df34f37d2470d246bc9be8d9836dfa49e (diff)
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>
Diffstat (limited to 'include/linux/console.h')
-rw-r--r--include/linux/console.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index 4585eb8e109e..d17f1f525bec 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -664,7 +664,7 @@ static inline bool nbcon_exit_unsafe(struct nbcon_write_context *wctxt) { return
static inline void nbcon_reacquire_nobuf(struct nbcon_write_context *wctxt) { }
static inline bool nbcon_kdb_try_acquire(struct console *con,
struct nbcon_write_context *wctxt) { return false; }
-static inline void nbcon_kdb_release(struct console *con) { }
+static inline void nbcon_kdb_release(struct nbcon_write_context *wctxt) { }
static inline bool console_is_usable(struct console *con, short flags,
bool use_atomic) { return false; }
#endif