serial: sh-sci: Clear RX, error, and break flags during reset
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 24 Jun 2016 14:59:15 +0000 (16:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2016 16:09:53 +0000 (09:09 -0700)
commit2768cf42874ae04bdbc33a9c9db96181dc0bbb8d
tree4298e3d7ee8b4e6c6c843fb4c3a66918a7d953b2
parent44763d3d301a13523186731b4797b181c78fe8b4
serial: sh-sci: Clear RX, error, and break flags during reset

Setting the FIFO reset bits is not sufficient to reset the RX FIFO.
After this the status register's RDF flag bit may still be set, causing
the reception of one stale byte of data.

To fix this, clear all status flag bits related to reception, error, and
break handling, cfr. the initialization flowchart in the datasheet.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sh-sci.c