mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
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 <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20250107074834.3115230-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
79d65fda55
commit
d78a899909
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user