A TX flush during an RS485 DMA transmission only stops the DMA. Nothing ends the transmission afterwards, so RTS stays asserted and the bus stays driven until the next write. End it from the flush, unless the TX interrupt is still enabled and ends it itself. Fixes: 8d479237727c ("serial: amba-pl011: add RS485 support") Cc: stable@vger.kernel.org # 6.18.x Signed-off-by: Nicolai Buchwitz --- A separate issue found while preparing v4 of the RS485 reconfiguration series: https://patch.msgid.link/20261021-devel-nbuchwitz-pl011-rs485-reconfig-stall-v4-0-ed10e219159a@tipi-net.de Tested on a Raspberry Pi CM5 (PL011 on RP1 with TX DMA). --- drivers/tty/serial/amba-pl011.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 79776a882ae35..b21de1f2c7807 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -343,6 +343,7 @@ struct uart_amba_port { }; static unsigned int pl011_tx_empty(struct uart_port *port); +static void pl011_rs485_tx_stop(struct uart_amba_port *uap); static unsigned int pl011_reg_to_offset(const struct uart_amba_port *uap, unsigned int reg) @@ -874,6 +875,11 @@ __acquires(&uap->port.lock) uap->dmacr &= ~UART011_TXDMAE; pl011_write(uap->dmacr, uap, REG_DMACR); } + + /* Without PIO the TX path won't run again, end an RS485 transmission */ + if ((port->rs485.flags & SER_RS485_ENABLED) && + uap->rs485_tx_state == SEND && !(uap->im & UART011_TXIM)) + pl011_rs485_tx_stop(uap); } static void pl011_dma_rx_callback(void *data); --- base-commit: 1184f87e2790e8af9be3116f608d2e86b4792d7d change-id: 20261021-devel-nbuchwitz-pl011-rs485-dma-flush-5f69eafe5b6d Best regards, -- Nicolai Buchwitz