Skip to content

Commit

Permalink
Revert "dmaengine: imx-sdma: refine to load context only once"
Browse files Browse the repository at this point in the history
commit 8592f02 upstream.

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

Fixes: ad0d92d ("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>
  • Loading branch information
Robin Gong authored and gregkh committed Sep 18, 2021
1 parent c159705 commit 8442f41
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions drivers/dma/imx-sdma.c
Expand Up @@ -379,7 +379,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;
};
Expand Down Expand Up @@ -954,9 +953,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)
Expand Down Expand Up @@ -999,8 +995,6 @@ static int sdma_load_context(struct sdma_channel *sdmac)

spin_unlock_irqrestore(&sdma->channel_0_lock, flags);

sdmac->context_loaded = true;

return ret;
}

Expand Down Expand Up @@ -1039,7 +1033,6 @@ static void sdma_channel_terminate_work(struct work_struct *work)
vchan_get_all_descriptors(&sdmac->vc, &head);
spin_unlock_irqrestore(&sdmac->vc.lock, flags);
vchan_dma_desc_free_list(&sdmac->vc, &head);
sdmac->context_loaded = false;
}

static int sdma_terminate_all(struct dma_chan *chan)
Expand Down Expand Up @@ -1307,7 +1300,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);

Expand Down

0 comments on commit 8442f41

Please sign in to comment.