Skip to content

Commit 4833794

Browse files
KAGA-KOKOpmladek
authored andcommitted
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>
1 parent ecb5e1a commit 4833794

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

kernel/panic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,8 @@ struct warn_args {
718718
void __warn(const char *file, int line, void *caller, unsigned taint,
719719
struct pt_regs *regs, struct warn_args *args)
720720
{
721+
nbcon_cpu_emergency_enter();
722+
721723
disable_trace_on_warning();
722724

723725
if (file)
@@ -753,6 +755,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
753755

754756
/* Just a warning, don't kill lockdep. */
755757
add_taint(taint, LOCKDEP_STILL_OK);
758+
759+
nbcon_cpu_emergency_exit();
756760
}
757761

758762
#ifdef CONFIG_BUG

0 commit comments

Comments
 (0)