[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74692e8a-220f-4248-9481-81bb331597f1@tuxon.dev>
Date: Mon, 26 Jan 2026 16:46:16 +0200
From: Claudiu Beznea <claudiu.beznea@...on.dev>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: vkoul@...nel.org, biju.das.jz@...renesas.com,
prabhakar.mahadev-lad.rj@...renesas.com, lgirdwood@...il.com,
broonie@...nel.org, perex@...ex.cz, tiwai@...e.com, p.zabel@...gutronix.de,
fabrizio.castro.jz@...esas.com, dmaengine@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-sound@...r.kernel.org,
linux-renesas-soc@...r.kernel.org,
Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
Subject: Re: [PATCH 6/7] ASoC: renesas: rz-ssi: Use generic PCM dmaengine APIs
Hi, Geert,
On 1/26/26 16:26, Geert Uytterhoeven wrote:
> Hi Claudiu,
>
> On Mon, 26 Jan 2026 at 11:32, Claudiu <claudiu.beznea@...on.dev> wrote:
>> From: Claudiu Beznea <claudiu.beznea.uj@...renesas.com>
>>
>> On Renesas RZ/G2L and RZ/G3S SoCs (where this was tested), captured audio
>> files occasionally contained random spikes when viewed with a profiling
>> 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) 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@...renesas.com>
>
> Thanks for your patch!
>
>> --- a/sound/soc/renesas/rz-ssi.c
>> +++ b/sound/soc/renesas/rz-ssi.c
>
>> @@ -1116,15 +936,19 @@ static struct snd_soc_dai_driver rz_ssi_soc_dai[] = {
>> static const struct snd_soc_component_driver rz_ssi_soc_component = {
>> .name = "rz-ssi",
>> .open = rz_ssi_pcm_open,
>> - .pointer = rz_ssi_pcm_pointer,
>> - .pcm_construct = rz_ssi_pcm_new,
>> .legacy_dai_naming = 1,
>> };
>>
>> +static struct snd_dmaengine_pcm_config rz_ssi_dmaegine_pcm_conf = {
>> + .prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config,
>
> This fails to link if CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM is not
> enabled (e.g. renesas_defconfig):
>
> aarch64-linux-gnu-ld: sound/soc/renesas/rz-ssi.o: in function
> `rz_ssi_probe':
> rz-ssi.c:(.text+0x538): undefined reference to
> `devm_snd_dmaengine_pcm_register'
> aarch64-linux-gnu-ld: sound/soc/renesas/rz-ssi.o:(.data+0xc8):
> undefined reference to `snd_dmaengine_pcm_prepare_slave_config'
>
> Adding a select like this white-space damaged snippet:
>
> --- 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 SND_SOC_GENERIC_DMAENGINE_PCM
> help
> This option enables RZ/G2L SSIF-2 sound support.
>
> would fix the build.
Thank you for reporting and proposing a fix. I'll take care of it in v2.
Claudiu
Powered by blists - more mailing lists