lkml.org 
[lkml]   [2022]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V2] tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete
On Thu, Aug 04, 2022 at 03:04:20PM +0800, Sherry Sun wrote:
> 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.
>
> Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
> ---
> Changes in V2:
> 1. Rephrase the commit log as suggested by Jiri.
> ---
> drivers/tty/serial/fsl_lpuart.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
> index fc7d235a1e27..f0fccd2ff7ac 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -2172,6 +2172,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
> uart_update_timeout(port, termios->c_cflag, baud);
>
> /* wait transmit engin complete */
> + lpuart32_write(&sport->port, 0, UARTMODIR);
> lpuart32_wait_bit_set(&sport->port, UARTSTAT, UARTSTAT_TC);
>
> /* disable transmit and receive */
> --
> 2.17.1

What commit id does this fix? Should it be backported to older stable
kernels?

thanks,

greg k-h

\
 
 \ /
  Last update: 2022-08-21 10:39    [W:0.073 / U:1.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site