dmaengine: fsl-edma: correct calculation of 'nbytes' in multi-fifo scenario
authorJoy Zou <joy.zou@nxp.com>
Wed, 31 Jan 2024 16:33:18 +0000 (11:33 -0500)
committerVinod Koul <vkoul@kernel.org>
Wed, 7 Feb 2024 08:34:59 +0000 (09:34 +0100)
The 'nbytes' should be equivalent to burst * width in audio multi-fifo
setups. Given that the FIFO width is fixed at 32 bits, adjusts the burst
size for multi-fifo configurations to match the slave maxburst in the
configuration.

Cc: stable@vger.kernel.org
Fixes: 72f5801a4e2b ("dmaengine: fsl-edma: integrate v3 support")
Signed-off-by: Joy Zou <joy.zou@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240131163318.360315-1-Frank.Li@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/fsl-edma-common.c

index b53f46245c377f05520c8275c95bf10c59be34d7..793f1a7ad5e343bbfe403c9e0ad28e891bd0d556 100644 (file)
@@ -503,7 +503,7 @@ void fsl_edma_fill_tcd(struct fsl_edma_chan *fsl_chan,
        if (fsl_chan->is_multi_fifo) {
                /* set mloff to support multiple fifo */
                burst = cfg->direction == DMA_DEV_TO_MEM ?
-                               cfg->src_addr_width : cfg->dst_addr_width;
+                               cfg->src_maxburst : cfg->dst_maxburst;
                nbytes |= EDMA_V3_TCD_NBYTES_MLOFF(-(burst * 4));
                /* enable DMLOE/SMLOE */
                if (cfg->direction == DMA_MEM_TO_DEV) {