From 6ae994d513a6ace5462137e1025a4e7086b87348 Mon Sep 17 00:00:00 2001 From: Ferry Toth Date: Sat, 10 Oct 2026 21:37:56 +0200 Subject: [PATCH] Revert "serial: 8250_port: Drop duplicate NULL check" This reverts commit 7885af04df6e4efd72910200c1bfc079d61202e4. Commit 7885af04df6e ("serial: 8250_port: Drop duplicate NULL check") added `up->dma = NULL;` to serial8250_release_dma(), with the stated intent of making sure DMA would not be used again after release. However, up->dma is assigned once at probe time. serial8250_do_startup() only calls serial8250_request_dma() when up->dma is non-NULL, so after the first close the pointer stays NULL and DMA is never re-acquired. On Intel Tangier (Edison) with HSU DMA this causes a regression: the first port open uses TX DMA, the second and later opens transmit in PIO mode, producing 64-byte FIFO bursts with ~50us gaps between them. Fixes: 7885af04df6e ("serial: 8250_port: Drop duplicate NULL check") Cc: stable@kernel.org Signed-off-by: Ferry Toth Acked-by: Andy Shevchenko Link: https://patch.msgid.link/20261010193755.187706-2-ftoth@exalondelft.nl Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 09e2c24de695..db066a42f61d 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2452,8 +2452,8 @@ void serial8250_do_shutdown(struct uart_port *port) synchronize_irq(port->irq); - serial8250_release_dma(up); - up->dma = NULL; + if (up->dma) + serial8250_release_dma(up); scoped_guard(uart_port_lock_irqsave, port) { if (port->flags & UPF_FOURPORT) {