]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ASoC: renesas: rz-ssi: Use proper dma_buffer_pos after resume
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Wed, 29 Oct 2025 14:11:34 +0000 (16:11 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 29 Oct 2025 14:54:46 +0000 (14:54 +0000)
commit22897e568646de5907d4981eae6cc895be2978d1
treefcbeb4e06e0761fe211f9426b1967ad9af4d919a
parent45f5c9eec43a9bf448f46562f146810831916cc9
ASoC: renesas: rz-ssi: Use proper dma_buffer_pos after resume

When the driver supports DMA, it enqueues four DMA descriptors per
substream before the substream is started. New descriptors are enqueued in
the DMA completion callback, and each time a new descriptor is queued, the
dma_buffer_pos is incremented.

During suspend, the DMA transactions are terminated. There might be cases
where the four extra enqueued DMA descriptors are not completed and are
instead canceled on suspend. However, the cancel operation does not take
into account that the dma_buffer_pos was already incremented.

Previously, the suspend code reinitialized dma_buffer_pos to zero, but this
is not always correct.

To avoid losing any audio periods during suspend/resume and to prevent
clip sound, save the completed DMA buffer position in the DMA callback and
reinitialize dma_buffer_pos on resume.

Cc: stable@vger.kernel.org
Fixes: 1fc778f7c833a ("ASoC: renesas: rz-ssi: Add suspend to RAM support")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Link: https://patch.msgid.link/20251029141134.2556926-3-claudiu.beznea.uj@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/renesas/rz-ssi.c