Re: [PATCH 3/4] tty: atmel_serial: take the port lock in console write
From: Praneeth Balasubramanian
Date: Sat Dec 05 2026 - 03:21:06 EST
On Sat, 05 Dec 2026 06:59:02 +0000, sashiko-bot@xxxxxxxxxx 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.