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 <[email protected]> Signed-off-by: John Ogness <[email protected]> Signed-off-by: Thomas Gleixner (Intel) <[email protected]> Reviewed-by: Petr Mladek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Mladek <[email protected]>
1 parent ecb5e1a commit 4833794

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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)