From 57c7e62b866aa4179d73827067e710ba4558db11 Mon Sep 17 00:00:00 2001 From: Kartik Date: Mon, 10 Jun 2024 17:34:31 +0000 Subject: [PATCH] NVIDIA: SAUCE: tty/serial: amba-pl011: Fix DMA hang with RTS and CTS enabled BugLink: https://bugs.launchpad.net/bugs/2080908 Function pl011_throttle_rx calls function pl011_stop_rx() to disable RX data transfer. This also disables the RX DMA by clearing RXDMAE bit of DMACR register. To unthrottle RX when DMA is used, function pl011_unthrottle_rx() is expected to set RXDMAE bit again to enable RX DMA. Set RXDMAE in DMACR register while unthrottling RX if RX DMA was in use. http://nvbugs/4701188 Signed-off-by: Kartik Tested-by: Petlozu Pravareshwar Reviewed-by: Petlozu Pravareshwar Signed-off-by: Laxman Dewangan Acked-by: Noah Wager Acked-by: Jacob Martin Signed-off-by: Noah Wager --- drivers/tty/serial/amba-pl011.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index c53aa3dd7845..585c9373e264 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1940,6 +1940,11 @@ static void pl011_unthrottle_rx(struct uart_port *port) } else { if (uap->vendor->eord_interrupt) pl011_write(NV_UART011_EORDIM, uap, REG_NV_MIM); + + if (uap->using_rx_dma) { + uap->dmacr |= UART011_RXDMAE; + pl011_write(uap->dmacr, uap, REG_DMACR); + } } pl011_write(uap->im, uap, REG_IMSC);