diff options
author | Huang Shijie <b32955@freescale.com> | 2014-06-11 02:55:53 -0400 |
---|---|---|
committer | Huang Shijie <b32955@freescale.com> | 2014-06-18 00:58:33 -0400 |
commit | 0431bb5a1b60856d015b463743e887099164c55a (patch) | |
tree | 681f625d968a9fe7de1eb27e0f2471d9db5db6c3 /drivers/tty | |
parent | a7b22ac7f8c8f766d1df9bb45abeb45af5c66f6b (diff) |
ENGR00318938-3 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 <b32955@freescale.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/imx.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 7a33b1d53015..2570a32bec19 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -1225,9 +1225,18 @@ static void imx_shutdown(struct uart_port *port) | |||
1225 | unsigned long flags; | 1225 | unsigned long flags; |
1226 | 1226 | ||
1227 | if (sport->dma_is_enabled) { | 1227 | if (sport->dma_is_enabled) { |
1228 | int ret; | ||
1229 | |||
1228 | /* We have to wait for the DMA to finish. */ | 1230 | /* We have to wait for the DMA to finish. */ |
1229 | wait_event(sport->dma_wait, | 1231 | ret = wait_event_interruptible(sport->dma_wait, |
1230 | !sport->dma_is_rxing && !sport->dma_is_txing); | 1232 | !sport->dma_is_rxing && !sport->dma_is_txing); |
1233 | if (ret != 0) { | ||
1234 | sport->dma_is_rxing = 0; | ||
1235 | sport->dma_is_txing = 0; | ||
1236 | dmaengine_terminate_all(sport->dma_chan_tx); | ||
1237 | dmaengine_terminate_all(sport->dma_chan_rx); | ||
1238 | } | ||
1239 | imx_stop_tx(port); | ||
1231 | imx_stop_rx(port); | 1240 | imx_stop_rx(port); |
1232 | imx_disable_dma(sport); | 1241 | imx_disable_dma(sport); |
1233 | imx_uart_dma_exit(sport); | 1242 | imx_uart_dma_exit(sport); |