SERIAL: omap: fix hardware assisted flow control
authorRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 5 Oct 2012 12:32:08 +0000 (13:32 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 4 Nov 2012 12:30:28 +0000 (12:30 +0000)
commit3af08bd7adb09b0806c51c06b87db08cc7075568
tree69b680bace06bb2127a69e883312dedcfb343544
parent2405464083e152f88bb58b7108a9e50ca362178c
SERIAL: omap: fix hardware assisted flow control

When the UART device has hardware flow control enabled, it ignores the
MCR RTS bit in the MCR register, and keeps RTS asserted as long as we
continue to read characters from the UART receiver FIFO.  This means
that when the TTY buffers become full, the UART doesn't tell the remote
end to stop sending, which causes the TTY layer to start dropping
characters.

A similar problem exists with software flow control.  We need the FIFO
register to fill when software flow control is enabled to provoke the
UART to send the XOFF character.

Fix this by implementing the throttle/unthrottle callbacks, and use
these to disable receiver interrupts.  This in turn means that the UART
FIFO will fill, which will then cause the UART's hardware to deassert
the RTS signal and/or send the XOFF character, stopping the remote end.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/tty/serial/omap-serial.c