提交 e92f9dc7 编写于 作者: P Peng Fan 提交者: Yang Yingliang

tty: serial: fsl_lpuart: fix lpuart32_poll_get_char

commit 29788ab1 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: NFugang Duan <fugang.duan@nxp.com>
Signed-off-by: NPeng 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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 08557d1f
...@@ -563,7 +563,7 @@ static void lpuart32_poll_put_char(struct uart_port *port, unsigned char c) ...@@ -563,7 +563,7 @@ static void lpuart32_poll_put_char(struct uart_port *port, unsigned char c)
static int lpuart32_poll_get_char(struct uart_port *port) 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 NO_POLL_CHAR;
return lpuart32_read(port, UARTDATA); return lpuart32_read(port, UARTDATA);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册