summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2023-09-11 18:53:04 +0300
committerAndy Hu <andy.hu@starfivetech.com>2024-12-06 13:24:25 +0300
commit22379f4cea9f986c22b43be022f7848e59db94c2 (patch)
treef3e8268474c073f665eeff37322667374d8bfbc6
parent7452ccc764296bb307d8f263390b53ed76575bc5 (diff)
downloadlinux-22379f4cea9f986c22b43be022f7848e59db94c2.tar.xz
panic: Mark emergency section in warn
Mark the full contents of __warn() as an emergency section. In this section, the CPU will not perform console output for the printk() calls. Instead, a flushing of the console output will triggered when exiting the emergency section. 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> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
-rw-r--r--kernel/panic.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/panic.c b/kernel/panic.c
index f0e91a0c4001..147803c3a402 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -663,6 +663,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)
@@ -693,6 +695,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