All of lore.kernel.org
 help / color / mirror / Atom feed
From: Praneeth Balasubramanian <praneethb2002@gmail.com>
To: sashiko-reviews@lists.linux.dev
Cc: Richard Genoud <richard.genoud@bootlin.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jirislaby@kernel.org>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/4] tty: atmel_serial: take the port lock in console write
Date: Sat,  5 Dec 2026 00:20:57 -0800	[thread overview]
Message-ID: <20261205082057.2597000-1-praneethb2002@gmail.com> (raw)
In-Reply-To: <sashiko-outbox-251173@kernel.org>

On Sat, 05 Dec 2026 06:59:02 +0000, sashiko-bot@kernel.org wrote:
> [Severity: Critical]
> Does taking port->lock here self-deadlock whenever atmel_serial logs while
> holding port->lock?
[...]
> [Severity: High]
> Can this self-deadlock against atmel_tasklet_rx_func() and
> atmel_tasklet_tx_func() when a hardirq calls printk()?
[...]
> [Severity: High]
> Does this introduce an ABBA deadlock between port->lock and
> console_owner on SMP?

These are right, so please drop this patch.

uart_set_iso7816_config() holds the port lock across
atmel_config_iso7816(), which can call dev_err(). The RX and TX tasklets
take the port lock with plain uart_port_lock(), so a hard interrupt that
prints can spin on it. The SysRq path prints under the port lock too.
With this patch the console write takes the same lock in all three
cases.

The race the patch was meant to close is still there. Fixing it needs
more than taking the lock in the console write: no printing under the
port lock, irq-safe locking in the tasklets, and SysRq handled after the
unlock. Moving the driver to the nbcon console callbacks, as amba-pl011
does, may be the cleaner way. v2 of this series will not include the
patch.


  reply	other threads:[~2026-12-05  8:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  6:35 [PATCH 0/4] tty: fix a stack overread and missing locking in serial drivers Praneeth Balasubramanian
2026-12-05  6:35 ` [PATCH 1/4] tty: hvsi: fix stack overread in hvsi_version_respond() Praneeth Balasubramanian
2026-12-05  6:53   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian
2026-12-05  6:35 ` [PATCH 2/4] serial: men_z135_uart: do not release an unrequested memory region Praneeth Balasubramanian
2026-12-05  6:35 ` [PATCH 3/4] tty: atmel_serial: take the port lock in console write Praneeth Balasubramanian
2026-12-05  6:59   ` sashiko-bot
2026-12-05  8:20     ` Praneeth Balasubramanian [this message]
2026-12-05  6:35 ` [PATCH 4/4] mxser: take termios_rwsem in mxser_set_serial_info() Praneeth Balasubramanian
2026-12-05  6:56   ` sashiko-bot
2026-12-05  6:59 ` [PATCH 0/4] tty: fix a stack overread and missing locking in serial drivers sashiko-bot

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=20261205082057.2597000-1-praneethb2002@gmail.com \
    --to=praneethb2002@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=richard.genoud@bootlin.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.