diff options
Diffstat (limited to 'drivers')
-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); |