linux/kernel/printk
Marcos Paulo de Souza 286b113d70 printk: nbcon: Allow KDB to acquire the NBCON context
KDB can interrupt any console to execute the "mirrored printing" at any
time, so add an exception to nbcon_context_try_acquire_direct to allow
to get the context if the current CPU is the same as kdb_printf_cpu.

This change will be necessary for the next patch, which fixes
kdb_msg_write to work with NBCON consoles by calling ->write_atomic on
such consoles. But to print it first needs to acquire the ownership of
the console, so nbcon_context_try_acquire_direct is fixed here.

Reviewed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://patch.msgid.link/20251016-nbcon-kgdboc-v6-3-866aac60a80e@suse.com
[pmladek@suse.com: Fix compilation with !CONFIG_KGDB_KDB.]
Signed-off-by: Petr Mladek <pmladek@suse.com>
2025-10-24 12:55:10 +02:00
..
.kunitconfig printk: ringbuffer: Add KUnit test 2025-06-18 16:42:42 +02:00
braille.c printk: Replace strncmp() with str_has_prefix() 2019-08-16 09:54:08 +02:00
braille.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
console_cmdline.h printk: Add match_devname_and_update_preferred_console() 2024-07-04 15:41:44 +02:00
index.c kernel/printk/index.c: fix memory leak with using debugfs_lookup() 2023-02-03 10:42:02 +01:00
internal.h printk: nbcon: Export console_is_usable 2025-10-24 12:19:23 +02:00
Makefile printk: ringbuffer: Add KUnit test 2025-06-18 16:42:42 +02:00
nbcon.c printk: nbcon: Allow KDB to acquire the NBCON context 2025-10-24 12:55:10 +02:00
printk.c panic: use angle-bracket include for panic.h 2025-09-13 17:32:54 -07:00
printk_ringbuffer.c printk changes for 6.18 2025-10-04 11:13:11 -07:00
printk_ringbuffer.h printk: nbcon: Init @nbcon_seq to highest possible 2024-09-04 15:56:32 +02:00
printk_ringbuffer_kunit_test.c printk: kunit: support offstack cpumask 2025-09-10 17:18:37 +02:00
printk_safe.c printk: Defer legacy printing when holding printk_cpu_sync 2024-12-16 13:26:31 +01:00
sysctl.c treewide: const qualify ctl_tables where applicable 2025-01-28 13:48:37 +01:00