]> git.baikalelectronics.ru Git - uboot.git/commit
serial: sh: Improve FIFO empty check on RX
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Sat, 9 May 2020 20:30:05 +0000 (22:30 +0200)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Tue, 1 Sep 2020 12:46:41 +0000 (14:46 +0200)
commit3c4a93b2b63283e5f5d9afdc72190a500f553264
tree116f369fa019660eeda65f8e03e63c29797c0b29
parent10b8a43f6b0b497bea4b8f6bb7b5ac2f8a6a5366
serial: sh: Improve FIFO empty check on RX

If the SCIF is receiving data quickly enough, it may happen that the
SCxSR_RDxF flag is cleared in sh_serial_getc_generic(), while the
FIFO still contains data. If that happens, the serial_getc_check()
reports no data in the FIFO as the flag is no longer set. Add one
more check, if the SCxSR_RDxF is not set, read out the FIFO level
and if there are still characters in the FIFO, permit reading them
out.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/serial/serial_sh.c