[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1418116296-12082-13-git-send-email-jiada_wang@mentor.com>
Date: Tue, 9 Dec 2014 18:11:33 +0900
From: Jiada Wang <jiada_wang@...tor.com>
To: <gregkh@...uxfoundation.org>, <jslaby@...e.cz>,
<linux-serial@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: <jiada_wang@...tor.com>, <anton_bondarenko@...tor.com>,
<dirk.behme@...bosch.com>
Subject: [PATCH v1 12/15] serial: imx: start rx_dma once RXFIFO is not empty
From: Robin Gong <b38343@...escale.com>
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@...escale.com>
Signed-off-by: Fugang Duan <B38611@...escale.com>
---
drivers/tty/serial/imx.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index a0f27b4..f0df233 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)
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists