* [PATCH] serial: 8250: account for partial receive DMA delivery to TTY
@ 2026-10-21 22:09 James Hilliard
2026-10-21 22:13 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: James Hilliard @ 2026-10-21 22:09 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Heikki Krogerus
Cc: linux-kernel, linux-serial, James Hilliard
tty_insert_flip_string() can accept fewer bytes than requested when the
flip buffer cannot grow. The DMA receive path advances past the entire
range regardless, but does not record that some bytes were dropped.
Increment buf_overrun on a short insertion, as the PIO receive path
does for a failed character insertion. Keep rx accounting for bytes
received from hardware and do not retry data after the DMA buffer has
been released.
Fixes: 9ee4b83e51f7 ("serial: 8250: Add support for dmaengine")
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
drivers/tty/serial/8250/8250_dma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c
index 1da605cc8601..46fe4ebbf451 100644
--- a/drivers/tty/serial/8250/8250_dma.c
+++ b/drivers/tty/serial/8250/8250_dma.c
@@ -57,7 +57,8 @@ static void __dma_rx_complete(struct uart_8250_port *p)
count = dma->rx_size - state.residue;
- tty_insert_flip_string(tty_port, dma->rx_buf, count);
+ if (tty_insert_flip_string(tty_port, dma->rx_buf, count) != count)
+ p->port.icount.buf_overrun++;
p->port.icount.rx += count;
dma->rx_running = 0;
---
base-commit: 1184f87e2790e8af9be3116f608d2e86b4792d7d
change-id: 20261021-submit-serial-8250-dma-rx-accounting-v1-4122c91dedbe
Best regards,
--
James Hilliard <james.hilliard1@gmail.com>
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-21 22:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-21 22:09 [PATCH] serial: 8250: account for partial receive DMA delivery to TTY James Hilliard
2026-10-21 22:13 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox