]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tty: serial: fsl_lpuart: switch to new dmaengine_terminate_* API
authorSherry Sun <sherry.sun@nxp.com>
Wed, 23 Nov 2022 02:36:19 +0000 (10:36 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:36 +0000 (12:10 +0200)
[ Upstream commit 8682ab0eea89c300ebb120c02ead3999ca5560a8 ]

Convert dmaengine_terminate_all() calls to synchronous and asynchronous
versions where appropriate.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Link: https://lore.kernel.org/r/20221123023619.30173-1-sherry.sun@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 1be6f2b15f90 ("tty: serial: fsl_lpuart: fix race on RX DMA shutdown")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/fsl_lpuart.c

index c51883f34ac2b56a19fa3ab5e71f2a0879b144af..86e96696ab26d6a2a4fa4ca90fb31eb940800efa 100644 (file)
@@ -582,7 +582,7 @@ static void lpuart_flush_buffer(struct uart_port *port)
                                sport->dma_tx_nents, DMA_TO_DEVICE);
                        sport->dma_tx_in_progress = false;
                }
-               dmaengine_terminate_all(chan);
+               dmaengine_terminate_async(chan);
        }
 
        if (lpuart_is_32(sport)) {
@@ -1333,7 +1333,7 @@ static void lpuart_dma_rx_free(struct uart_port *port)
                                        struct lpuart_port, port);
        struct dma_chan *chan = sport->dma_rx_chan;
 
-       dmaengine_terminate_all(chan);
+       dmaengine_terminate_sync(chan);
        dma_unmap_sg(chan->device->dev, &sport->rx_sgl, 1, DMA_FROM_DEVICE);
        kfree(sport->rx_ring.buf);
        sport->rx_ring.tail = 0;
@@ -1766,7 +1766,7 @@ static void lpuart_dma_shutdown(struct lpuart_port *sport)
                if (wait_event_interruptible_timeout(sport->dma_wait,
                        !sport->dma_tx_in_progress, msecs_to_jiffies(300)) <= 0) {
                        sport->dma_tx_in_progress = false;
-                       dmaengine_terminate_all(sport->dma_tx_chan);
+                       dmaengine_terminate_sync(sport->dma_tx_chan);
                }
                sport->lpuart_dma_tx_use = false;
        }
@@ -2867,7 +2867,7 @@ static int __maybe_unused lpuart_suspend(struct device *dev)
 
        if (sport->lpuart_dma_tx_use) {
                sport->dma_tx_in_progress = false;
-               dmaengine_terminate_all(sport->dma_tx_chan);
+               dmaengine_terminate_sync(sport->dma_tx_chan);
        }
 
        if (sport->port.suspended && !irq_wake)