]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "dmaengine: imx-sdma: refine to load context only once"
authorRobin Gong <yibin.gong@nxp.com>
Wed, 14 Jul 2021 10:20:43 +0000 (18:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:21 +0000 (12:26 +0200)
commit 8592f02464d52776c5cfae4627c6413b0ae7602d upstream.

This reverts commit ad0d92d7ba6aecbe2705907c38ff8d8be4da1e9c, because
in spi-imx case, burst length may be changed dynamically.

Fixes: ad0d92d7ba6a ("dmaengine: imx-sdma: refine to load context only once")
Cc: <stable@vger.kernel.org>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/imx-sdma.c

index 67736c801f3caa69220030b2f1d2bce9b9c0e9f9..d1220899735e3c23d13e274073cec6bc2cd7f6c7 100644 (file)
@@ -377,7 +377,6 @@ struct sdma_channel {
        unsigned long                   watermark_level;
        u32                             shp_addr, per_addr;
        enum dma_status                 status;
-       bool                            context_loaded;
        struct imx_dma_data             data;
        struct work_struct              terminate_worker;
 };
@@ -988,9 +987,6 @@ static int sdma_load_context(struct sdma_channel *sdmac)
        int ret;
        unsigned long flags;
 
-       if (sdmac->context_loaded)
-               return 0;
-
        if (sdmac->direction == DMA_DEV_TO_MEM)
                load_address = sdmac->pc_from_device;
        else if (sdmac->direction == DMA_DEV_TO_DEV)
@@ -1033,8 +1029,6 @@ static int sdma_load_context(struct sdma_channel *sdmac)
 
        spin_unlock_irqrestore(&sdma->channel_0_lock, flags);
 
-       sdmac->context_loaded = true;
-
        return ret;
 }
 
@@ -1074,7 +1068,6 @@ static void sdma_channel_terminate_work(struct work_struct *work)
        sdmac->desc = NULL;
        spin_unlock_irqrestore(&sdmac->vc.lock, flags);
        vchan_dma_desc_free_list(&sdmac->vc, &head);
-       sdmac->context_loaded = false;
 }
 
 static int sdma_disable_channel_async(struct dma_chan *chan)
@@ -1335,7 +1328,6 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
        sdmac->event_id0 = 0;
        sdmac->event_id1 = 0;
-       sdmac->context_loaded = false;
 
        sdma_set_channel_priority(sdmac, 0);