Skip to content

Commit 2e7b5cf

Browse files
1991Joyzouvinodkoul
authored andcommitted
dmaengine: fsl-edma: fix channel parameter config for fixed channel requests
Configure only the requested channel when a fixed channel is specified to avoid modifying other channels unintentionally. Fix parameter configuration when a fixed DMA channel is requested on i.MX9 AON domain and i.MX8QM/QXP/DXL platforms. When a client requests a fixed channel (e.g., channel 6), the driver traverses channels 0-5 and may unintentionally modify their configuration if they are unused. This leads to issues such as setting the `is_multi_fifo` flag unexpectedly, causing memcpy tests to fail when using the dmatest tool. Only affect edma memcpy test when the channel is fixed. Fixes: 72f5801 ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Joy Zou <joy.zou@nxp.com> Cc: stable@vger.kernel.org Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20250917-b4-edma-chanconf-v1-1-886486e02e91@nxp.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 6de23f8 commit 2e7b5cf

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

drivers/dma/fsl-edma-main.c

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -317,28 +317,24 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec,
317317
return NULL;
318318
i = fsl_chan - fsl_edma->chans;
319319

320-
fsl_chan->priority = dma_spec->args[1];
321-
fsl_chan->is_rxchan = dma_spec->args[2] & FSL_EDMA_RX;
322-
fsl_chan->is_remote = dma_spec->args[2] & FSL_EDMA_REMOTE;
323-
fsl_chan->is_multi_fifo = dma_spec->args[2] & FSL_EDMA_MULTI_FIFO;
320+
if (!b_chmux && i != dma_spec->args[0])
321+
continue;
324322

325323
if ((dma_spec->args[2] & FSL_EDMA_EVEN_CH) && (i & 0x1))
326324
continue;
327325

328326
if ((dma_spec->args[2] & FSL_EDMA_ODD_CH) && !(i & 0x1))
329327
continue;
330328

331-
if (!b_chmux && i == dma_spec->args[0]) {
332-
chan = dma_get_slave_channel(chan);
333-
chan->device->privatecnt++;
334-
return chan;
335-
} else if (b_chmux && !fsl_chan->srcid) {
336-
/* if controller support channel mux, choose a free channel */
337-
chan = dma_get_slave_channel(chan);
338-
chan->device->privatecnt++;
339-
fsl_chan->srcid = dma_spec->args[0];
340-
return chan;
341-
}
329+
fsl_chan->srcid = dma_spec->args[0];
330+
fsl_chan->priority = dma_spec->args[1];
331+
fsl_chan->is_rxchan = dma_spec->args[2] & FSL_EDMA_RX;
332+
fsl_chan->is_remote = dma_spec->args[2] & FSL_EDMA_REMOTE;
333+
fsl_chan->is_multi_fifo = dma_spec->args[2] & FSL_EDMA_MULTI_FIFO;
334+
335+
chan = dma_get_slave_channel(chan);
336+
chan->device->privatecnt++;
337+
return chan;
342338
}
343339
return NULL;
344340
}

0 commit comments

Comments
 (0)