Commit d78a8999 authored by Sherry Sun's avatar Sherry Sun Committed by Greg Kroah-Hartman
Browse files

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: default avatarSherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20250107074834.3115230-1-sherry.sun@nxp.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 79d65fda
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1965,6 +1965,11 @@ static void lpuart32_shutdown(struct uart_port *port)
			UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE | UARTCTRL_SBK);
	lpuart32_write(port, temp, UARTCTRL);

	/* flush Rx/Tx FIFO */
	temp = lpuart32_read(port, UARTFIFO);
	temp |= UARTFIFO_TXFLUSH | UARTFIFO_RXFLUSH;
	lpuart32_write(port, temp, UARTFIFO);

	uart_port_unlock_irqrestore(port, flags);

	lpuart_dma_shutdown(sport);