summaryrefslogtreecommitdiff
path: root/kernel/panic.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-08-20 08:35:58 +0206
committerPetr Mladek <pmladek@suse.com>2024-08-21 15:03:04 +0200
commit4833794db61c8cc4de4563a2754c7aedaffbb684 (patch)
treea780d76be71a7fb04a136c9a3e3887de3a40ea88 /kernel/panic.c
parentecb5e1aa82c86642ec1eaafefd4e317dfba3a238 (diff)
panic: Mark emergency section in warn
Mark the full contents of __warn() as an emergency section. In this section, every printk() call will attempt to directly flush to the consoles using the EMERGENCY priority. Co-developed-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: John Ogness <john.ogness@linutronix.de> Signed-off-by: Thomas Gleixner (Intel) <tglx@linutronix.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://lore.kernel.org/r/20240820063001.36405-33-john.ogness@linutronix.de Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r--kernel/panic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index 93096d5abcc7..1a10b6e2a855 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -718,6 +718,8 @@ struct warn_args {
void __warn(const char *file, int line, void *caller, unsigned taint,
struct pt_regs *regs, struct warn_args *args)
{
+ nbcon_cpu_emergency_enter();
+
disable_trace_on_warning();
if (file)
@@ -753,6 +755,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
/* Just a warning, don't kill lockdep. */
add_taint(taint, LOCKDEP_STILL_OK);
+
+ nbcon_cpu_emergency_exit();
}
#ifdef CONFIG_BUG