Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 72f5801a4e2b ("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>

authored by

Joy Zou and committed by
Vinod Koul
2e7b5cf7 6de23f81

+11 -15
+11 -15
drivers/dma/fsl-edma-main.c
··· 317 317 return NULL; 318 318 i = fsl_chan - fsl_edma->chans; 319 319 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; 324 322 325 323 if ((dma_spec->args[2] & FSL_EDMA_EVEN_CH) && (i & 0x1)) 326 324 continue; ··· 326 328 if ((dma_spec->args[2] & FSL_EDMA_ODD_CH) && !(i & 0x1)) 327 329 continue; 328 330 329 - if (!b_chmux && i == dma_spec->args[0]) { 330 - chan = dma_get_slave_channel(chan); 331 - chan->device->privatecnt++; 332 - return chan; 333 - } else if (b_chmux && !fsl_chan->srcid) { 334 - /* if controller support channel mux, choose a free channel */ 335 - chan = dma_get_slave_channel(chan); 336 - chan->device->privatecnt++; 337 - fsl_chan->srcid = dma_spec->args[0]; 338 - return chan; 339 - } 331 + fsl_chan->srcid = dma_spec->args[0]; 332 + fsl_chan->priority = dma_spec->args[1]; 333 + fsl_chan->is_rxchan = dma_spec->args[2] & FSL_EDMA_RX; 334 + fsl_chan->is_remote = dma_spec->args[2] & FSL_EDMA_REMOTE; 335 + fsl_chan->is_multi_fifo = dma_spec->args[2] & FSL_EDMA_MULTI_FIFO; 336 + 337 + chan = dma_get_slave_channel(chan); 338 + chan->device->privatecnt++; 339 + return chan; 340 340 } 341 341 return NULL; 342 342 }