Linux-Serial Archive on lore.kernel.org
 help / color / Atom feed
* RE: [PATCH] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
  2020-09-29  9:55 [PATCH] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char Peng Fan
@ 2020-09-29  9:36 ` Andy Duan
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Duan @ 2020-09-29  9:36 UTC (permalink / raw)
  To: Peng Fan, gregkh, jirislaby, andrew.smirnov
  Cc: linux-serial, linux-kernel, dl-linux-imx

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
@ 2020-09-29  9:55 Peng Fan
  2020-09-29  9:36 ` Andy Duan
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Fan @ 2020-09-29  9:55 UTC (permalink / raw)
  To: gregkh, jirislaby, andrew.smirnov
  Cc: linux-serial, linux-kernel, linux-imx, Peng Fan, Fugang Duan

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))
 		return NO_POLL_CHAR;
 
 	return lpuart32_read(port, UARTDATA);
-- 
2.28.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29  9:55 [PATCH] tty: serial: fsl_lpuart: fix lpuart32_poll_get_char Peng Fan
2020-09-29  9:36 ` Andy Duan

Linux-Serial Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-serial/0 linux-serial/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-serial linux-serial/ https://lore.kernel.org/linux-serial \
		linux-serial@vger.kernel.org
	public-inbox-index linux-serial

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-serial


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git