Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Imre Kaloz <kaloz@kernel.org>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	linux-serial@vger.kernel.org, Petr Mladek <pmladek@suse.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	John Ogness <john.ogness@linutronix.de>,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: Re: [PATCH v2] MIPS: SGI-IP27: print the NMI dump on an nbcon console
Date: Thu, 5 Nov 2026 16:23:30 +0100	[thread overview]
Message-ID: <auyfcm7ml2fUmfUG@alpha.franken.de> (raw)
In-Reply-To: <20261001191938.3256-1-kaloz@kernel.org>

On Thu, Oct 01, 2026 at 09:19:38PM +0200, Imre Kaloz wrote:
> Since the 8250 console became nbcon, printk() in nmi_dump() only queues
> records for a printer thread that never runs, as no CPU leaves the NMI
> handler. Print from an emergency section and flush pending records
> before the hub reset.
> 
> Fixes: d3539347022a ("serial: 8250: Switch to nbcon console, take 2")
> Signed-off-by: Imre Kaloz <kaloz@kernel.org>
> ---
> v2: flush pending records before the hub reset (John Ogness)
> v1: https://lore.kernel.org/all/20261001155013.1694-1-kaloz@kernel.org/
> 
> This conflicts by context with patch 14/38 of the IP35 series,
> https://lore.kernel.org/all/76f2a9c32eba23de36817f0a186def01e009e1c7.1790857966.git.kaloz@kernel.org/
> which rewrites the reset write. Whichever lands second places the
> printk_trigger_flush() call above the system_is_ip35 branch.
> 
>  arch/mips/sgi-ip27/ip27-nmi.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/mips/sgi-ip27/ip27-nmi.c b/arch/mips/sgi-ip27/ip27-nmi.c
> index fc2816398d0c..c502982621e6 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.
> @@ -227,5 +234,6 @@ static void nmi_dump(void)
>  	 * Save the nmi cpu registers for all cpu in the eframe format.
>  	 */
>  	nmi_eframes_save();
> +	printk_trigger_flush();
>  	LOCAL_HUB_S(NI_PORT_RESET, NPR_PORTRESET | NPR_LOCALRESET);
>  }
> -- 
> 2.47.3

applied to mips-fixes

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

      parent reply	other threads:[~2026-11-05 15:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-01 19:19 [PATCH v2] MIPS: SGI-IP27: print the NMI dump on an nbcon console Imre Kaloz
2026-10-01 19:55 ` John Ogness
2026-10-02  7:27 ` Petr Mladek
2026-10-02  9:30   ` Greg Kroah-Hartman
2026-10-02  9:13 ` sashiko-bot
2026-11-05 15:23 ` Thomas Bogendoerfer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auyfcm7ml2fUmfUG@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=kaloz@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox