diff mbox series

serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt

Message ID 20231030183951.15331-1-rwahl@gmx.de
State Superseded
Headers show
Series serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt | expand

Commit Message

Ronald Wahl Oct. 30, 2023, 6:39 p.m. UTC
Starting RX DMA on THRI interrupt is too early because TX may not have
finished yet.

This change is inspired by commit 90b8596ac460 ("serial: 8250: Prevent
starting up DMA Rx on THRI interrupt") and fixes DMA issues I had with
an AM62 SoC that is using the 8250 OMAP variant.

Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
---
 drivers/tty/serial/8250/8250_omap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--
2.41.0
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index c7ab2963040b..f2f59ec6b50b 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1282,10 +1282,11 @@  static int omap_8250_dma_handle_irq(struct uart_port *port)

 	status = serial_port_in(port, UART_LSR);

-	if (priv->habit & UART_HAS_EFR2)
-		am654_8250_handle_rx_dma(up, iir, status);
-	else
-		status = omap_8250_handle_rx_dma(up, iir, status);
+	if ((iir & 0x3f) != UART_IIR_THRI)
+		if (priv->habit & UART_HAS_EFR2)
+			am654_8250_handle_rx_dma(up, iir, status);
+		else
+			status = omap_8250_handle_rx_dma(up, iir, status);

 	serial8250_modem_status(up);
 	if (status & UART_LSR_THRE && up->dma->tx_err) {