diff options
| author | John Ogness <john.ogness@linutronix.de> | 2024-08-20 08:35:52 +0206 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2024-08-21 14:56:24 +0200 |
| commit | 5dde3b7354133846079fa51e55e74ef90a836759 (patch) | |
| tree | 28e69b6323463f7e8b403154158eb7028b46ae0c /include/linux/printk.h | |
| parent | d2e85ca7a736d2d889bac9aef6ede0a67f6870b2 (diff) | |
printk: nbcon: Add unsafe flushing on panic
Add nbcon_atomic_flush_unsafe() to flush all nbcon consoles
using the write_atomic() callback and allowing unsafe hostile
takeovers. Call this at the end of panic() as a final attempt
to flush any pending messages.
Note that legacy consoles use unsafe methods for flushing
from the beginning of panic (see bust_spinlocks()). Therefore,
systems using both legacy and nbcon consoles may still fail to
see panic messages due to unsafe legacy console usage.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240820063001.36405-27-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'include/linux/printk.h')
| -rw-r--r-- | include/linux/printk.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index 9687089f5ace..2e083f01f8a3 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -202,6 +202,7 @@ void printk_trigger_flush(void); void console_try_replay_all(void); extern bool nbcon_device_try_acquire(struct console *con); extern void nbcon_device_release(struct console *con); +void nbcon_atomic_flush_unsafe(void); #else static inline __printf(1, 0) int vprintk(const char *s, va_list args) @@ -294,6 +295,10 @@ static inline void nbcon_device_release(struct console *con) { } +static inline void nbcon_atomic_flush_unsafe(void) +{ +} + #endif bool this_cpu_in_panic(void); |
