Skip to content

Commit 2df467e

Browse files
ADESTMvinodkoul
authored andcommitted
dmaengine: stm32-dma: fix stm32_dma_prep_slave_sg in case of MDMA chaining
Current Target (CT) have to be reset when starting an MDMA chaining use case, as Double Buffer mode is activated. It ensures the DMA will start processing the first memory target (pointed with SxM0AR). Fixes: 7237951 ("dmaengine: stm32-dma: add support to trigger STM32 MDMA") Signed-off-by: Amelie Delaunay <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 5849704 commit 2df467e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/dma/stm32-dma.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,8 +1113,10 @@ static struct dma_async_tx_descriptor *stm32_dma_prep_slave_sg(
11131113
chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_PFCTRL;
11141114

11151115
/* Activate Double Buffer Mode if DMA triggers STM32 MDMA and more than 1 sg */
1116-
if (chan->trig_mdma && sg_len > 1)
1116+
if (chan->trig_mdma && sg_len > 1) {
11171117
chan->chan_reg.dma_scr |= STM32_DMA_SCR_DBM;
1118+
chan->chan_reg.dma_scr &= ~STM32_DMA_SCR_CT;
1119+
}
11181120

11191121
for_each_sg(sgl, sg, sg_len, i) {
11201122
ret = stm32_dma_set_xfer_param(chan, direction, &buswidth,

0 commit comments

Comments
 (0)