summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2020-09-29 17:55:09 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-29 09:07:20 +0100
commit69a0cf3fb401682d50ee4a229c1b4aff884df321 (patch)
tree1db15fe368301d3ce371ceb6a603b1dea8d10ee5 /drivers/tty
parent728f57428dc84301f05f8cbc7cd2f6d2dbfe2d5a (diff)
downloadlinux-stable-69a0cf3fb401682d50ee4a229c1b4aff884df321.tar.gz
linux-stable-69a0cf3fb401682d50ee4a229c1b4aff884df321.tar.bz2
linux-stable-69a0cf3fb401682d50ee4a229c1b4aff884df321.zip
tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
commit 29788ab1d2bf26c130de8f44f9553ee78a27e8d5 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 16422987ab0f..cebebdcd091c 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -567,7 +567,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);