MLK-17133-03 tty: serial: lpuart: directly terminate rx dma chans in .shutdown()
authorFugang Duan <fugang.duan@nxp.com>
Fri, 8 Dec 2017 08:12:50 +0000 (16:12 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:50:59 +0000 (14:50 -0500)
No need to wait dma_wait event, directly terminate rx dma chans
in .shutdown() callback.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
drivers/tty/serial/fsl_lpuart.c

index a3ebd3f..b7a5f33 100644 (file)
@@ -1422,12 +1422,8 @@ static void lpuart_shutdown(struct uart_port *port)
        spin_unlock_irqrestore(&port->lock, flags);
 
        if (sport->lpuart_dma_rx_use) {
-               ret = wait_event_interruptible_timeout(sport->dma_wait,
-                       !sport->dma_rx_in_progress, msecs_to_jiffies(1));
-               if (ret <= 0) {
-                       sport->dma_rx_in_progress = false;
-                       dmaengine_terminate_all(sport->dma_rx_chan);
-               }
+               sport->dma_rx_in_progress = false;
+               dmaengine_terminate_all(sport->dma_rx_chan);
                del_timer_sync(&sport->lpuart_timer);
                lpuart_dma_rx_free(&sport->port);
        }
@@ -1471,12 +1467,8 @@ static void lpuart32_shutdown(struct uart_port *port)
        spin_unlock_irqrestore(&port->lock, flags);
 
        if (sport->lpuart_dma_rx_use) {
-               ret = wait_event_interruptible_timeout(sport->dma_wait,
-                       !sport->dma_rx_in_progress, msecs_to_jiffies(1));
-               if (ret <= 0) {
-                       sport->dma_rx_in_progress = false;
-                       dmaengine_terminate_all(sport->dma_rx_chan);
-               }
+               sport->dma_rx_in_progress = false;
+               dmaengine_terminate_all(sport->dma_rx_chan);
                if (!sport->dma_eeop)
                        del_timer_sync(&sport->lpuart_timer);
                lpuart_dma_rx_free(&sport->port);