summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorKe Qinghua <qinghua.ke@freescale.com>2014-07-04 12:21:41 +0800
committerKe Qinghua <qinghua.ke@freescale.com>2014-07-04 12:21:41 +0800
commit9a37f431167d1b8442384a016b929e5bdf7edb60 (patch)
tree15d5e8c229a280a3c83c81c96f2e9e88521937ce /drivers/tty
parent27139bfdda97e95e9897eeec281295378deadb8c (diff)
parent982f8797664030b41e0bb0ad39f138767ab89c7c (diff)
Merge remote-tracking branch 'remotes/fsl-linux-sdk/imx_3.10.31_1.1.0_beta' into imx_3.10.y_android
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/imx.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index fc82b6efb0ef..a8f2215dffbc 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1227,9 +1227,25 @@ static void imx_shutdown(struct uart_port *port)
if (sport->dma_is_enabled) {
int ret;
+ /*
+ * Before DMA finish, we have to disable flow control, otherwise
+ * there have one corner issue like:
+ * Flow control enable, RTS always is high while there have no uart
+ * terminal connect to imx uart, and then user transmit data by the
+ * uart, after some time, TX FIFO is _FULL_, SDMA still don't complete
+ * the current transcation, so hold on. There no SDMA interrupt generate,
+ * the "dma_wait" event cannot be waked up.
+ */
+ if (sport->have_rtscts) {
+ temp = readl(sport->port.membase + UCR2) & ~UCR2_CTSC;
+ temp |= UCR2_CTS;
+ writel(temp, sport->port.membase + UCR2);
+ }
+
/* We have to wait for the DMA to finish. */
- ret = wait_event_interruptible(sport->dma_wait,
- !sport->dma_is_rxing && !sport->dma_is_txing);
+ ret = wait_event_interruptible_timeout(sport->dma_wait,
+ !sport->dma_is_rxing && !sport->dma_is_txing,
+ msecs_to_jiffies(1));
if (ret != 0) {
sport->dma_is_rxing = 0;
sport->dma_is_txing = 0;