Skip to content

Commit 3f4b821

Browse files
nxpfranklivinodkoul
authored andcommitted
dmaengine: fsl-edma: fix edma4 channel enable failure on second attempt
When attempting to start DMA for the second time using fsl_edma3_enable_request(), channel never start. CHn_MUX must have a unique value when selecting a peripheral slot in the channel mux configuration. The only value that may overlap is source 0. If there is an attempt to write a mux configuration value that is already consumed by another channel, a mux configuration of 0 (SRC = 0) will be written. Check CHn_MUX before writing in fsl_edma3_enable_request(). 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 54a5aff commit 3f4b821

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/dma/fsl-edma-common.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,14 @@ static void fsl_edma3_enable_request(struct fsl_edma_chan *fsl_chan)
9292

9393
edma_writel_chreg(fsl_chan, val, ch_sbr);
9494

95-
if (flags & FSL_EDMA_DRV_HAS_CHMUX)
96-
edma_writel_chreg(fsl_chan, fsl_chan->srcid, ch_mux);
95+
if (flags & FSL_EDMA_DRV_HAS_CHMUX) {
96+
/*
97+
* ch_mux: With the exception of 0, attempts to write a value
98+
* already in use will be forced to 0.
99+
*/
100+
if (!edma_readl_chreg(fsl_chan, ch_mux))
101+
edma_writel_chreg(fsl_chan, fsl_chan->srcid, ch_mux);
102+
}
97103

98104
val = edma_readl_chreg(fsl_chan, ch_csr);
99105
val |= EDMA_V3_CH_CSR_ERQ;

0 commit comments

Comments
 (0)