]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: fsl_asrc_dma: fix eDMA maxburst misalignment with channel count
authorShengjiu Wang <shengjiu.wang@nxp.com>
Thu, 25 Jun 2026 10:24:16 +0000 (18:24 +0800)
committerMark Brown <broonie@kernel.org>
Thu, 25 Jun 2026 13:56:27 +0000 (14:56 +0100)
commitcf6f56990ea21172e085f0588e5bbf2089ce8f58
tree0f12732de2c209cb83c293e474f9e73e15202e83
parentc5315c8dcbcb9271f59662104428cd9229c9a7cb
ASoC: fsl_asrc_dma: fix eDMA maxburst misalignment with channel count

The back-end consumes data in units of the number of channels. When the
maxburst value is not evenly divisible by the channel count, the DMA
transfer length does not align with the FIFO frame boundary, causing
wrong data to be copied and audible noise at the end of the stream.

This is specific to eDMA: eDMA only responds to DMA requests from the
back-end, whereas SDMA handles requests from both the front-end and the
back-end and is not affected.

For eDMA, when the back-end maxburst is not evenly divisible by the
channel count, align it to the nearest valid boundary:
- If maxburst >= channel count, override to the channel count so each
  transfer corresponds to exactly one audio frame.
- If maxburst < channel count, override to 1 to avoid partial-frame
  transfers.

Retain the original maxburst for SDMA or when it already aligns with
the channel count.

Fixes: c05f10f28ef6 ("ASoC: fsl_asrc: Add support for imx8qm & imx8qxp")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://patch.msgid.link/20260625102416.424911-1-shengjiu.wang@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_asrc_dma.c