Skip to content

Commit d78a899

Browse files
SherrySun5gregkh
authored andcommitted
tty: serial: fsl_lpuart: flush RX and TX FIFO when lpuart shutdown
Need to flush UART RX and TX FIFO when lpuart is shutting down to make sure restore a clean data transfer environment. Signed-off-by: Sherry Sun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 79d65fd commit d78a899

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,11 @@ static void lpuart32_shutdown(struct uart_port *port)
19651965
UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE | UARTCTRL_SBK);
19661966
lpuart32_write(port, temp, UARTCTRL);
19671967

1968+
/* flush Rx/Tx FIFO */
1969+
temp = lpuart32_read(port, UARTFIFO);
1970+
temp |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH;
1971+
lpuart32_write(port, temp, UARTFIFO);
1972+
19681973
uart_port_unlock_irqrestore(port, flags);
19691974

19701975
lpuart_dma_shutdown(sport);

0 commit comments

Comments
 (0)