Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Sherry Sun <sherry.sun@nxp.com>
Cc: jirislaby@kernel.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-imx@nxp.com
Subject: Re: [PATCH V2] tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete
Date: Sun, 21 Aug 2022 10:38:26 +0200	[thread overview]
Message-ID: <YwHvAsOmMaa6rmm0@kroah.com> (raw)
In-Reply-To: <20220804070420.32186-1-sherry.sun@nxp.com>

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

  parent reply	other threads:[~2022-08-21  8:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  7:04 [PATCH V2] tty: serial: lpuart: disable flow control while waiting for the transmit engine to complete Sherry Sun
2022-08-15  8:04 ` Sherry Sun
2022-08-21  8:38 ` Greg KH [this message]
2022-08-21 10:01   ` Sherry Sun
2022-08-21 10:07     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YwHvAsOmMaa6rmm0@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=sherry.sun@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox