Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] serial: 8250_omap: clear rx_running on zero-length DMA completes
@ 2026-05-21 13:30 Matthias Feser
  2026-05-22  5:40 ` Moteen Shah
  0 siblings, 1 reply; 10+ messages in thread
From: Matthias Feser @ 2026-05-21 13:30 UTC (permalink / raw)
  To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
	jirislaby@kernel.org
  Cc: linux-kernel@vger.kernel.org, k-willis@ti.com, m-shah@ti.com,
	msp@baylibre.com, andriy.shevchenko@linux.intel.com

On AM33xx RX DMA only triggers when the FIFO reaches the
configured threshold (typically 48 bytes). For smaller bursts
no DMA request is issued and the FIFO is drained by RX timeout.

In this case __dma_rx_do_complete() can legitimately see count == 0.

The current code exits early in this case and does not clear
dma->rx_running, leaving the DMA state inconsistent. This can
prevent RX DMA from restarting and may cause
omap_8250_rx_dma_flush() to fail, marking DMA as broken.

Fix this by always clearing dma->rx_running on exit.

Signed-off-by: Matthias Feser <mfe@KBSgmbhfr.onmicrosoft.com>
---
 drivers/tty/serial/8250/8250_omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index c552c6b9a037..686e54859aa5 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -948,11 +948,11 @@ static void __dma_rx_do_complete(struct uart_8250_port *p)
 		goto out;
 	ret = tty_insert_flip_string(tty_port, dma->rx_buf, count);
 
-	dma->rx_running = 0;
 	p->port.icount.rx += ret;
 	p->port.icount.buf_overrun += count - ret;
 out:
 
+	dma->rx_running = 0;
 	tty_flip_buffer_push(tty_port);
 }
 
-- 
2.39.5


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-05-23  5:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 13:30 [PATCH] serial: 8250_omap: clear rx_running on zero-length DMA completes Matthias Feser
2026-05-22  5:40 ` Moteen Shah
2026-05-22  8:24   ` [PATCH v2] " Matthias Feser
2026-05-22  8:25     ` Moteen Shah
2026-05-22  8:28     ` Moteen Shah
2026-05-22  9:02       ` AW: [PATCH v3] " Matthias Feser
2026-05-22 10:18         ` Moteen Shah
2026-05-22 12:37           ` [PATCH v4] " Matthias Feser
2026-05-23  5:47             ` gregkh
2026-05-22  8:46     ` [PATCH v2] " gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox