summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorRobin Gong <b38343@freescale.com>2014-12-09 18:11:33 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-09 14:23:59 -0800
commitee5e7c1091a703c6a465d8145e9b55e09adb6f37 (patch)
tree2ead6ca7b06150c1f04e7944729f591df6b654da /drivers/tty
parent068500e08dc87ea9a453cc4a500cf3ab28d0f936 (diff)
downloadblackbird-obmc-linux-ee5e7c1091a703c6a465d8145e9b55e09adb6f37.tar.gz
blackbird-obmc-linux-ee5e7c1091a703c6a465d8145e9b55e09adb6f37.zip
serial: imx: start rx_dma once RXFIFO is not empty
Start rx_dma once RXFIFO is not empty that can avoid dma request lost and causes data delay issue. Signed-off-by: Robin Gong <b38343@freescale.com> Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index ab958a59cae9..d61b89e4a96e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -946,8 +946,21 @@ static void dma_rx_callback(void *data)
tty_flip_buffer_push(port);
start_rx_dma(sport);
- } else
+ } else if (readl(sport->port.membase + USR2) & USR2_RDR) {
+ /*
+ * start rx_dma directly once data in RXFIFO, more efficient
+ * than before:
+ * 1. call imx_rx_dma_done to stop dma if no data received
+ * 2. wait next RDR interrupt to start dma transfer.
+ */
+ start_rx_dma(sport);
+ } else {
+ /*
+ * stop dma to prevent too many IDLE event trigged if no data
+ * in RXFIFO
+ */
imx_rx_dma_done(sport);
+ }
}
static int start_rx_dma(struct imx_port *sport)
OpenPOWER on IntegriCloud