Skip to content

Commit d5a2e08

Browse files
SherrySun5gregkh
authored andcommitted
tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete
When the user initializes the uart port, and waits for the transmit engine to complete in lpuart32_set_termios(), if the UART TX fifo has dirty data and the UARTMODIR enable the flow control, the TX fifo may never be empty. So here we should disable the flow control first to make sure the transmit engin can complete. Fixes: 380c966 ("tty: serial: fsl_lpuart: add 32-bit register interface support") Cc: stable <stable@kernel.org> Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://lore.kernel.org/r/20220821101527.10066-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 56c14fb commit d5a2e08

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/tty/serial/fsl_lpuart.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,6 +2191,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
21912191
uart_update_timeout(port, termios->c_cflag, baud);
21922192

21932193
/* wait transmit engin complete */
2194+
lpuart32_write(&sport->port, 0, UARTMODIR);
21942195
lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
21952196

21962197
/* disable transmit and receive */

0 commit comments

Comments
 (0)