OSDN Git Service

serial: 8250: 8250_omap: Fix throttling when DMA is enabled
authorVignesh R <vigneshr@ti.com>
Thu, 8 Feb 2018 12:55:42 +0000 (18:25 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Feb 2018 12:40:22 +0000 (13:40 +0100)
commit08fb00c64f3401b4ecc18a7395cf302b8d8e12fd
tree54dfc521c5ddd543a194992d1465232cebf09b71
parent2e9fe539108320820016f78ca7704a7342788380
serial: 8250: 8250_omap: Fix throttling when DMA is enabled

omap_8250_throttle() is called when tty RX buffer is about to overflow
and can no longer keep up with the rate at which UART is receiving data.
So, the expectation of this callback, is that UART stops RX and asserts
HW flow control to signal the sender to stop sending more data.
omap_8250_throttle() disables RX FIFO interrupts thus FIFO is no longer
serviced, leading to assertion of flow control once RX FIFO is full.
But, this does not work when DMA is enabled as driver keeps queuing new
RX DMA request in completion handler without brothering about throttling
request made by the higher layer.
This patch introduces a flag that can be used to determine whether or
not to queue next RX DMA request based on throttling request.

Without this patch, tty buffer overflows are reported at higher
baudrates.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_omap.c