Re: [PATCH] tty: serial: samsung: Remove redundant port lock acquisition in rx helpers
From: Krzysztof Kozlowski
Date: Sun May 24 2026 - 15:42:20 EST
On 15/05/2026 14:41, Tudor Ambarus wrote:
> Sashiko identified a deadlock when the console flow is engaged [1].
>
> When console flow control is enabled (UPF_CONS_FLOW),
> s3c24xx_serial_stop_tx() calls s3c24xx_serial_rx_enable() and
> s3c24xx_serial_start_tx() calls s3c24xx_serial_rx_disable().
>
> The serial core framework invokes the .stop_tx() and .start_tx()
> callbacks with the port->lock spinlock already held. Furthermore, all
> internal driver paths that invoke stop_tx (such as the DMA TX
> completion handler s3c24xx_serial_tx_dma_complete() or the PIO TX IRQ
> handler s3c24xx_serial_tx_irq()) also acquire port->lock prior to
> calling it. (Note that s3c24xx_serial_start_tx() is only invoked by the
> serial core).
>
> However, s3c24xx_serial_rx_enable() and s3c24xx_serial_rx_disable()
> unconditionally attempt to acquire port->lock again using
> uart_port_lock_irqsave(). Since spinlocks are not recursive, this
> causes a deadlock on the same CPU when console flow control is engaged.
>
> Remove the redundant lock acquisition from both rx helper functions.
>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxxxxx>
Best regards,
Krzysztof