From 9fbcb7ca5ba5862d1c597ae52ed331c406071403 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Tue, 21 May 2024 11:11:53 +0800 Subject: [PATCH] serial: 8250_port: fix dma tx issue on rockchip Fixes: e8ffbb71f783 ("serial: 8250: use THRE & __stop_tx also with DMA") Change-Id: I8c30f0413a3ff7f9f36ee089ee1be5f3f4a0d045 Signed-off-by: Huibin Hong --- drivers/tty/serial/8250/8250_port.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 4a9a8c081c92..c79a29bf4c76 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2001,9 +2001,12 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) #endif serial8250_modem_status(up); #ifdef CONFIG_ARCH_ROCKCHIP - if ((!up->dma || (up->dma && (!up->dma->txchan || up->dma->tx_err))) && - ((iir & 0xf) == UART_IIR_THRI)) - serial8250_tx_chars(up); + if ((iir & 0xf) == UART_IIR_THRI) { + if (!up->dma || (up->dma && (!up->dma->txchan || up->dma->tx_err))) + serial8250_tx_chars(up); + else if (!up->dma->tx_running) + __stop_tx(up); + } #else if ((status & UART_LSR_THRE) && (up->ier & UART_IER_THRI)) { if (!up->dma || up->dma->tx_err)