On i.MX8MP, watchdog diagnostics captured repeated UART TX-ready interrupts with tx_state OFF, an empty transmit buffer and no pending x_char. The normal transmit handler calls imx_uart_stop_tx(), but that function returns early when the state is OFF without clearing UCR1_TRDYEN or UCR4_TCEN. A still-enabled TX interrupt can starve the CPU and prevent the watchdog from being serviced. Clear both TX interrupt enable bits before returning from the OFF branch of imx_uart_stop_tx(). This also handles stopped transmission with data still queued, a buffer drained by the transmit handler, and platforms using a separate TX interrupt handler. Keep the existing DMA and RS485 handling for other TX states unchanged. UART and RX remain enabled. Subsequent transmission can enable TX interrupts again through the normal start path. The origin of the inconsistent state is not yet known. This change addresses the observed interrupt loop, not the initial state mismatch. Fixes: cb1a60923609 ("serial: imx: implement rts delaying for rs485") Cc: stable@vger.kernel.org Signed-off-by: Michael Glembotzki --- Runtime-tested on i.MX8MP hardware with an NXP-based Linux 6.6.161 kernel. Mainline has not been runtime-tested. Changes in v2: - Disable TRDYEN and TCEN in the OFF branch of imx_uart_stop_tx() instead of handling only an empty buffer in the combined IRQ handler. - Add the Fixes tag for the commit introducing the early return. v1: https://lore.kernel.org/linux-serial/20261202111526.664966-2-Michael.Glembotzki@iris-sensing.com/ drivers/tty/serial/imx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -415,8 +415,15 @@ static void imx_uart_stop_tx(struct uart_port *port) struct imx_port *sport = to_imx_port(port); u32 ucr1, ucr4, usr2; - if (sport->tx_state == OFF) + if (sport->tx_state == OFF) { + /* Disable stale TX interrupts even when already stopped. */ + ucr1 = imx_uart_readl(sport, UCR1); + imx_uart_writel(sport, ucr1 & ~UCR1_TRDYEN, UCR1); + + ucr4 = imx_uart_readl(sport, UCR4); + imx_uart_writel(sport, ucr4 & ~UCR4_TCEN, UCR4); return; + } /* * We are maybe in the SMP context, so if the DMA TX thread is running -- 2.56.1