Skip to content

Commit dc51b44

Browse files
nxpfranklivinodkoul
authored andcommitted
dmaengine: fsl-edma: fix eDMAv4 channel allocation issue
The eDMAv4 channel mux has a limitation where certain requests must use even channels, while others must use odd numbers. Add two flags (ARGS_EVEN_CH and ARGS_ODD_CH) to reflect this limitation. The device tree source (dts) files need to be updated accordingly. This issue was identified by the following commit: commit a725990 ("arm64: dts: imx93: Fix the dmas entries order") Reverting channel orders triggered this problem. Fixes: 72f5801 ("dmaengine: fsl-edma: integrate v3 support") Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent f60dfe0 commit dc51b44

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/dma/fsl-edma-main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#define ARGS_RX BIT(0)
2525
#define ARGS_REMOTE BIT(1)
2626
#define ARGS_MULTI_FIFO BIT(2)
27+
#define ARGS_EVEN_CH BIT(3)
28+
#define ARGS_ODD_CH BIT(4)
2729

2830
static void fsl_edma_synchronize(struct dma_chan *chan)
2931
{
@@ -157,6 +159,12 @@ static struct dma_chan *fsl_edma3_xlate(struct of_phandle_args *dma_spec,
157159
fsl_chan->is_remote = dma_spec->args[2] & ARGS_REMOTE;
158160
fsl_chan->is_multi_fifo = dma_spec->args[2] & ARGS_MULTI_FIFO;
159161

162+
if ((dma_spec->args[2] & ARGS_EVEN_CH) && (i & 0x1))
163+
continue;
164+
165+
if ((dma_spec->args[2] & ARGS_ODD_CH) && !(i & 0x1))
166+
continue;
167+
160168
if (!b_chmux && i == dma_spec->args[0]) {
161169
chan = dma_get_slave_channel(chan);
162170
chan->device->privatecnt++;

0 commit comments

Comments
 (0)