tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode
authorPaul Walmsley <paul@pwsan.com>
Thu, 26 Jan 2012 02:50:36 +0000 (19:50 -0700)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 27 Apr 2012 23:14:09 +0000 (02:14 +0300)
commit22ae61ce8a5b16570a2cd278aa9cec1987ddb13f
tree8b7d82d485ad8942bd1725aacc13d6b88db4bd4c
parentedb132ee88a3caf113df538b48d92b2df9f364df
tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode

In the (default) PIO mode, use a one-byte RX FIFO threshold.  The OMAP
UART IP blocks do not appear to be capable of waking the system under
an RX timeout condition.  Since the previous RX FIFO threshold was 16
bytes, this meant that omap-serial.c did not become aware of any
received data until all those bytes arrived or until another UART
interrupt occurred.  This made the serial console and presumably other
serial applications (GPS, serial Bluetooth) unusable or extremely
slow.  A 1-byte RX FIFO threshold also allows the MPU to enter a
low-power consumption state while waiting for the FIFO to fill.

This can be verified using the serial console by comparing the
behavior when "0123456789abcde" is pasted in from another window, with
the behavior when "0123456789abcdef" is pasted in.  Since the former
string is less than sixteen bytes long, the string is not echoed for
some time, while the latter string is echoed immediately.

DMA operation is unaffected by this patch.

Thanks to Russell King - ARM Linux <linux@arm.linux.org.uk> for some
additional information on the standard behavior of the RX timeout
event, which was used to improve this commit description.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
[notasas@gmail.com: backported some dependencies]
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Govindraj Raja <govindraj.r@ti.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Russell King <linux@arm.linux.org.uk>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/plat-omap/include/plat/omap-serial.h
drivers/tty/serial/omap-serial.c