]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
panic: Mark emergency section in warn
authorThomas Gleixner <tglx@linutronix.de>
Tue, 20 Aug 2024 06:29:58 +0000 (08:35 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 21 Aug 2024 13:03:04 +0000 (15:03 +0200)
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>
kernel/panic.c

index 93096d5abcc7789da44f9746982abf2e09987b75..1a10b6e2a8550377276400216ffb587265462966 100644 (file)
@@ -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