Re: [PATCH v2 6/7] ASoC: renesas: rz-ssi: Use generic PCM dmaengine APIs
From: Geert Uytterhoeven
Date: Wed Mar 25 2026 - 04:17:15 EST
Hi Claudiu,
On Fri, 20 Mar 2026 at 12:28, Claudiu <claudiu.beznea@xxxxxxxxx> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
>
> On Renesas RZ/G2L and RZ/G3S SoCs (where this was tested), captured audio
> files occasionally contained random spikes when viewed with a tool such
> as Audacity. These spikes were also audible as popping noises.
>
> Using cyclic DMA resolves this issue. The driver was reworked to use the
> existing support provided by the generic PCM dmaengine APIs. In addition
> to eliminating the random spikes, the following issues were addressed:
> - blank periods at the beginning of recorded files, which occurred
> intermittently, are no longer present
> - no overruns or underruns were observed when continuously recording
> short audio files (e.g. 5 seconds long) in a loop
> - concurrency issues in the SSI driver when enqueuing DMA requests were
> eliminated; previously, DMA requests could be prepared and submitted
> both from the DMA completion callback and the interrupt handler, which
> led to crashes after several hours of testing
> - the SSI driver logic is simplified
> - the number of generated interrupts is reduced by approximately 250%
>
> In the SSI platform driver probe function, the following changes were
> made:
> - the driver-specific DMA configuration was removed in favor of the
> generic PCM dmaengine APIs. As a result, explicit cleanup goto labels
> are no longer required and the driver remove callback was dropped,
> since resource management is now handled via devres helpers
> - special handling was added for IP variants operating in half-duplex
> mode, where the DMA channel name in the device tree is "rt"; this DMA
> channel name is taken into account and passed to the generic PCM
> dmaengine configuration data
>
> All code previously responsible for preparing and completing DMA
> transfers was removed, as this functionality is now handled entirely by
> the generic PCM dmaengine APIs.
>
> Since DMA channels must be paused and resumed during recovery paths
> (overruns and underruns), the DMA channel references are stored in
> rz_ssi_hw_params().
>
> The logic in rz_ssi_is_dma_enabled() was updated to reflect that the
> driver no longer manages DMA transfers directly.
>
> Finally, rz_ssi_stream_is_play() was removed, as it had only a single
> remaining user after this rework, and its logic was inlined at the call
> site.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
Thanks for your patch!
> --- a/sound/soc/renesas/Kconfig
> +++ b/sound/soc/renesas/Kconfig
> @@ -56,6 +56,7 @@ config SND_SOC_MSIOF
> config SND_SOC_RZ
> tristate "RZ/G2L series SSIF-2 support"
> depends on ARCH_RZG2L || COMPILE_TEST
> + select CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM
Please drop the "CONFIG_"-prefix.
> help
> This option enables RZ/G2L SSIF-2 sound support.
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds