Skip to content

Commit

Permalink
tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
Browse files Browse the repository at this point in the history
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>
Link: https://lore.kernel.org/r/20200929095509.21680-1-peng.fan@nxp.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peng Fan authored and Greg Kroah-Hartman committed Sep 30, 2020
1 parent 9ea40db commit 29788ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/tty/serial/fsl_lpuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29788ab

Please sign in to comment.