[PATCH 0/2] serial: 8250: serialize DMA cancellation with buffer reuse

From: James Hilliard

Date: Wed Oct 21 2026 - 18:38:05 EST


Keep canceled transmit and receive buffers reserved until the provider's
completion callbacks have finished. The TX fix also separates the DMA
source from the serial core's kfifo, which is reset before the driver is
called to flush a transfer. The RX fix keeps partial-buffer delivery ahead
of the PIO fallback while the canceled descriptor is retired.

These changes repair the existing finite-transfer DMA path.
DMA providers must honor the existing terminate/synchronize contract;
fixes for providers that do not are separate DMAengine work.

Based on tty-next with the posted shutdown guard [0], channel
configuration error handling [1], and RX TTY accounting fix [2].

[0] https://lore.kernel.org/r/20261021-submit-serial-8250-dma-shutdown-v1-v1-1-3d3ce383c614@xxxxxxxxx
[1] https://lore.kernel.org/r/20261021-submit-serial-8250-dma-config-errors-v1-v1-1-c067587d1ef2@xxxxxxxxx
[2] https://lore.kernel.org/r/20261021-submit-serial-8250-dma-rx-accounting-v1-v1-1-c11795914ab4@xxxxxxxxx

Assisted-by: Codex:gpt-6-astra
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
James Hilliard (2):
serial: 8250: drain canceled TX DMA before reusing its buffer
serial: 8250: retire canceled RX DMA before reusing the receive buffer

drivers/tty/serial/8250/8250.h | 20 +++-
drivers/tty/serial/8250/8250_dma.c | 205 ++++++++++++++++++++++++++----------
drivers/tty/serial/8250/8250_dw.c | 8 +-
drivers/tty/serial/8250/8250_mid.c | 6 +-
drivers/tty/serial/8250/8250_omap.c | 26 +++--
drivers/tty/serial/8250/8250_port.c | 3 +-
6 files changed, 191 insertions(+), 77 deletions(-)
---
base-commit: 1184f87e2790e8af9be3116f608d2e86b4792d7d
change-id: 20261021-submit-serial-8250-dma-cancel-v1-b208f84e89c1
prerequisite-patch-id: 3604bfaa3a1c214997de1f11162b81a4541af5ab
prerequisite-patch-id: 79dd093ffb35e254e790dffb8887faf51b64f947
prerequisite-patch-id: 80a5061d84c055a64c760268febed179c687b99f

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>