linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Duan <fugang.duan@nxp.com>
To: Peng Fan <peng.fan@nxp.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"jirislaby@kernel.org" <jirislaby@kernel.org>,
	"andrew.smirnov@gmail.com" <andrew.smirnov@gmail.com>
Cc: "linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
Date: Tue, 29 Sep 2020 09:36:23 +0000	[thread overview]
Message-ID: <AM8PR04MB73157339D0AC240C3DAAD64BFF320@AM8PR04MB7315.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20200929095509.21680-1-peng.fan@nxp.com>

From: Peng Fan <peng.fan@nxp.com> Sent: Tuesday, September 29, 2020 5:55 PM
> The watermark is set to 1, so we need to input two chars to trigger RDRF using
> the original logic. With the new logic, we could always get the char when there
> is data in FIFO.
> 
> Suggested-by: Fugang Duan <fugang.duan@nxp.com>
> Signed-off-by: Peng Fan <peng.fan@nxp.com>
> ---
>  drivers/tty/serial/fsl_lpuart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index
> 645bbb24b433..1c37280b6c0c 100644
> --- a/drivers/tty/serial/fsl_lpuart.c
> +++ b/drivers/tty/serial/fsl_lpuart.c
> @@ -680,7 +680,7 @@ static void lpuart32_poll_put_char(struct uart_port
> *port, unsigned char c)
> 
>  static int lpuart32_poll_get_char(struct uart_port *port)  {
> -	if (!(lpuart32_read(port, UARTSTAT) & UARTSTAT_RDRF))
> +	if (!(lpuart32_read(port, UARTWATER) >>  UARTWATER_RXCNT_OFF))

Please remove redundant blank space.

>  		return NO_POLL_CHAR;
> 
>  	return lpuart32_read(port, UARTDATA);
> --
> 2.28.0


      reply	other threads:[~2020-09-29  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29  9:55 [PATCH] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char Peng Fan
2020-09-29  9:36 ` Andy Duan [this message]

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=AM8PR04MB73157339D0AC240C3DAAD64BFF320@AM8PR04MB7315.eurprd04.prod.outlook.com \
    --to=fugang.duan@nxp.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=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=peng.fan@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;
as well as URLs for NNTP newsgroup(s).