aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorHuang Shijie <shijie8@gmail.com>2014-09-19 03:42:57 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-28 21:26:38 -0400
commita4688bcd34bd2f4fe7fb88856c85d3091270ab53 (patch)
tree6e62880c92f034c22abe46c5a5e8d3cc5faf2c8e /drivers/tty
parent45564a6656b4944fa90aabd59f8ec082e8f7a969 (diff)
serial: imx: change the wait even to interruptiable
The wait_event() makes the application hang for ever in the following case: [1] the hardware flow control is enabled. [2] the other end (or the remote end) is terminated, and the TX is still waiting for the hardware flow control signal to become asserted. This patch fixes it by changing the wait_event to wait_event_interruptible. Signed-off-by: Huang Shijie <shijie8@gmail.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.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index db749f768ac4..8f62a3cec23e 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1219,9 +1219,18 @@ static void imx_shutdown(struct uart_port *port)
1219 unsigned long flags; 1219 unsigned long flags;
1220 1220
1221 if (sport->dma_is_enabled) { 1221 if (sport->dma_is_enabled) {
1222 int ret;
1223
1222 /* We have to wait for the DMA to finish. */ 1224 /* We have to wait for the DMA to finish. */
1223 wait_event(sport->dma_wait, 1225 ret = wait_event_interruptible(sport->dma_wait,
1224 !sport->dma_is_rxing && !sport->dma_is_txing); 1226 !sport->dma_is_rxing && !sport->dma_is_txing);
1227 if (ret != 0) {
1228 sport->dma_is_rxing = 0;
1229 sport->dma_is_txing = 0;
1230 dmaengine_terminate_all(sport->dma_chan_tx);
1231 dmaengine_terminate_all(sport->dma_chan_rx);
1232 }
1233 imx_stop_tx(port);
1225 imx_stop_rx(port); 1234 imx_stop_rx(port);
1226 imx_disable_dma(sport); 1235 imx_disable_dma(sport);
1227 imx_uart_dma_exit(sport); 1236 imx_uart_dma_exit(sport);