amba-pl011: Report AUTOCTS capability to framework
authorPhil Elwell <phil@raspberrypi.org>
Wed, 11 Oct 2017 12:48:04 +0000 (13:48 +0100)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:57:22 +0000 (15:57 +0100)
commit56b45c5c9c01175f6637aebdf19b017323ba1983
tree70370e944169745806cd2c966867d1471f86c912
parentbdf632d9fd34f22adb130df1532a6f17c9c9c650
amba-pl011: Report AUTOCTS capability to framework

The PL011 has full hardware RTS/CTS support which is enabled by
the driver when flow control is requested. However, it doesn't
notify the UART framework of the fact, causing the software CTS
support to be enabled at the same time.

Software CTS triggers the sending of another batch of characters
when CTS becomes asserted. The pl011 interrupt handler processes
the CTIS bit before TXIS, which can cause some characters to be
sent between the time that the TXIS bit first becomes asserted
and the time it is handled by a call to px011_tx_chars. This
would be fine were it not for the optimisation in pl011_tx_char
that assumes the FIFO is half-empty if called from the interrupt
handler and skips the checking of the FIFO status register before
sending each character, leading to data loss if the FIFO is more
than half-full.

Prevent the data loss and improve efficiency by indicating the
AUTOCTS support.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/tty/serial/amba-pl011.c