Re: [PATCH] MIPS: SGI-IP27: print the NMI dump on an nbcon console
From: John Ogness
Date: Thu Oct 01 2026 - 12:41:21 EST
On 2026-10-01, Imre Kaloz <kaloz@xxxxxxxxxx> wrote:
> Since the 8250 console became nbcon, printk() in nmi_dump() only queues
> records for the printer thread, which never runs because no CPU leaves
> the NMI handler before the hub reset. Print the dump from an emergency
> section.
Please excuse my ignorance, but could you inform me about the context?
When is nmi_dump() called? Does the hardware always reset/reboot/hang
from this call?
> Fixes: d3539347022a ("serial: 8250: Switch to nbcon console, take 2")
> Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
> ---
> arch/mips/sgi-ip27/ip27-nmi.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
> index fc2816398d0c..4447c0bec8b4 100644
> --- a/arch/mips/sgi-ip27/ip27-nmi.c
> +++ b/arch/mips/sgi-ip27/ip27-nmi.c
> @@ -1,4 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
> +#include <linux/console.h>
> #include <linux/kernel.h>
> #include <linux/mmzone.h>
> #include <linux/nodemask.h>
> @@ -183,6 +184,12 @@ static void nmi_dump(void)
> */
> arch_spin_lock(&nmi_lock);
>
> + /*
> + * No CPU leaves the NMI handler before the hub reset below, so an
> + * nbcon console's printer thread would never print the dump.
> + */
> + nbcon_cpu_emergency_enter();
> +
> #ifdef REAL_NMI_SIGNAL
> /*
> * Wait up to 15 seconds for the other cpus to respond to the NMI.
The CPU enters an emergency state, but shouldn't it exit the emergency
state at some point? Or does the machine always unstoppably
reset/reboot/hang after this point?
John Ogness