From: sashiko-bot@kernel.org
To: "Eliav Farber" <farbere@amazon.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held
Date: Mon, 30 Nov 2026 16:09:19 +0000 [thread overview]
Message-ID: <sashiko-outbox-241547@kernel.org> (raw)
In-Reply-To: <20261130155133.37435-1-farbere@amazon.com>
> uart_port_lock() and its variants take the port lock and then spin until
> they own the nbcon console context, which synchronizes port->lock users
> against the write_atomic() callback. The context is requested at
> NBCON_PRIO_NORMAL, and while another CPU is in panic that request is
> always refused, so the spin never ends.
>
> The CPU is left holding the port lock, and in the _irq and _irqsave
> cases it is left with interrupts disabled, so it stops answering the
> stop IPI from panic(). Triggering a panic from a shell on the serial
> console reproduces this: a CPU enters the wrapper while the tty is
> transmitting and never leaves it. On an 8250 console the panic output
> slows to tens of milliseconds per character and never reaches the
> reboot.
>
> Fix this by retrying with the port lock released and interrupts
> restored. __uart_port_using_nbcon() is re-tested on each attempt because
> the console can be unregistered while the lock is dropped. A caller that
> already has interrupts disabled still spins, but no longer holds the
> port lock.
>
> This message and change were written with the help of an AI coding
> assistant. I reviewed everything, corrected a few things, and tested
> the result on arm64 hardware with an 8250 console.
>
> Fixes: 4126f149c48b ("serial: core: Acquire nbcon context in port->lock wrapper")
> Cc: stable@vger.kernel.org
> Signed-off-by: Eliav Farber <farbere@amazon.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261130155133.37435-1-farbere@amazon.com?part=1
prev parent reply other threads:[~2026-11-30 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 15:51 [PATCH] serial: core: Don't spin for nbcon ownership with the port lock held Eliav Farber
2026-11-30 16:09 ` sashiko-bot [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=sashiko-outbox-241547@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=farbere@amazon.com \
--cc=linux-serial@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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