Re: [RFC PATCH v1] panic: Flush unsafe consoles before panic reboot
From: Breno Leitao
Date: Tue Oct 27 2026 - 13:44:38 EST
On Tue, Oct 27, 2026 at 09:12:09AM -0700, Breno Leitao wrote:
> So netconsole, or any CON_NBCON_ATOMIC_UNSAFE console, prints nothing
> on kdump hosts.
For flushing unsafe on nbcon on hosts with kdump environment, this seems
to do the work, but, maybe this is too unsafe !?
diff --git a/kernel/crash_core.c b/kernel/crash_core.c
index d0bd2d0cf8990b..9f1a89e301ff01 100644
--- a/kernel/crash_core.c
+++ b/kernel/crash_core.c
@@ -140,6 +140,8 @@ void __noclone __crash_kexec(struct pt_regs *regs)
crash_setup_regs(&fixed_regs, regs);
crash_save_vmcoreinfo();
+ /* Flush consoles with an unsafe write_atomic(), e.g. netconsole. */
+ nbcon_atomic_flush_unsafe();
machine_crash_shutdown(&fixed_regs);
crash_cma_clear_pending_dma();
machine_kexec(kexec_crash_image);