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. The still-asserted interrupt can starve the CPU and prevent the watchdog from being serviced. When this precise idle condition is observed in the interrupt handler, clear TRDYEN and continue the normal handler. Keep UART and RX enabled; subsequent transmission can enable TX-ready interrupts through the regular TX path. Do not change behavior when characters are pending. The origin of the inconsistent state is not yet known. This change addresses the observed interrupt loop, not the initial state mismatch. Cc: stable@vger.kernel.org Signed-off-by: Michael Glembotzki --- Tested on i.MX8MP hardware with an NXP-based Linux 6.6.161 kernel. The mainline adaptation was compile-tested for ARM64, including console support, but has not been runtime-tested. For a 6.6 backport, the transmit-buffer check needs to use uart_circ_empty(&sport->port.state->xmit) instead of kfifo_is_empty(&sport->port.state->port.xmit_fifo). drivers/tty/serial/imx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 0831bd5..258e03b 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -1038,6 +1038,14 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) } if ((usr1 & USR1_TRDY) || (usr2 & USR2_TXDC)) { + /* An idle transmitter must not keep firing a ready interrupt. */ + if ((usr1 & USR1_TRDY) && sport->tx_state == OFF && + !sport->port.x_char && + kfifo_is_empty(&sport->port.state->port.xmit_fifo)) { + u32 current_ucr1 = imx_uart_readl(sport, UCR1); + + imx_uart_writel(sport, current_ucr1 & ~UCR1_TRDYEN, UCR1); + } imx_uart_transmit_buffer(sport); ret = IRQ_HANDLED; } -- 2.56.1