]> git.baikalelectronics.ru Git - kernel.git/commit
serial: imx: Fix imx_flush_buffer()
authorFabio Estevam <fabio.estevam@freescale.com>
Tue, 13 Jan 2015 12:00:26 +0000 (10:00 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Feb 2015 18:11:24 +0000 (10:11 -0800)
commitc735df0867f67ad0db5f9d57a1eea56f724d68fb
treeca28c2c469b8d9f7091f89c1575de278de24e3dc
parent280e35bbbd4fb99753045b43b6348f73dbbc0543
serial: imx: Fix imx_flush_buffer()

When running an userspace program that does a 'tcflush(fd, TCIOFLUSH)' call
we still see the last received character in the URXD register afterwards.

Clear UCR2_SRST bit so that the UART FIFO is flushed properly.

Since UCR2_SRST also resets some UART registers, we need to save and restore
some of them.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Tested-by: Fugang Duan <B38611@freescale.com>
Acked-by: Jason Liu <r64343@freecale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c