mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Christian Hewitt" <christianshewitt@gmail.com>
Cc: neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org
Subject: Re: [PATCH v3] ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop
Date: Sat, 27 Jun 2026 13:24:19 +0000	[thread overview]
Message-ID: <20260627132419.B377F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260627131205.808800-1-christianshewitt@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Calling `snd_soc_component_write()` in the ALSA PCM `trigger` callback attempts to acquire a sleeping mutex in an atomic context.
--

commit 1376cbf94327e951ccd270ef5b1029d5db3c5d0f
Author: Christian Hewitt <christianshewitt@gmail.com>

ASoC: meson: aiu: fifo-spdif: soft reset the S/PDIF datapath on start/stop

This commit soft-resets the spdif datapath on start and stop to fix "machine 
gun noise" buffer underruns. It mirrors the downstream vendor driver's 
behavior by toggling the reset bits.

> diff --git a/sound/soc/meson/aiu-fifo-spdif.c b/sound/soc/meson/aiu-fifo-spdif.c
> index e0e00ec026dcc..a9861c5d66374 100644
> --- a/sound/soc/meson/aiu-fifo-spdif.c
> +++ b/sound/soc/meson/aiu-fifo-spdif.c

[ ... ]

> @@ -68,11 +69,15 @@ static int fifo_spdif_trigger(struct snd_pcm_substream *substream, int cmd,
>  	case SNDRV_PCM_TRIGGER_START:
>  	case SNDRV_PCM_TRIGGER_RESUME:
>  	case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> +		snd_soc_component_write(component, AIU_RST_SOFT,
> +					AIU_RST_SOFT_958_FAST);

[Severity: High]
Does this code attempt to sleep in an atomic context?

The audio core executes the trigger callback atomically with
snd_pcm_stream_lock_irq() (unless the non-atomic flag is set by the machine
driver, which is not the case for gx-card.c).

However, snd_soc_component_write() unconditionally attempts to acquire a
sleeping mutex:

sound/soc/soc-component.c:snd_soc_component_write() {
    ...
    mutex_lock(&component->io_mutex);
    ...
}

Will this lead to a scheduling while atomic splat when starting the stream?

>  		fifo_spdif_dcu_enable(component, true);
>  		break;
>  	case SNDRV_PCM_TRIGGER_SUSPEND:
>  	case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
>  	case SNDRV_PCM_TRIGGER_STOP:
> +		snd_soc_component_write(component, AIU_RST_SOFT,
> +					AIU_RST_SOFT_958_FAST);

[Severity: High]
Can this write also trigger a sleeping in atomic context regression when
stopping the device?

>  		fifo_spdif_dcu_enable(component, false);
>  		break;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260627131205.808800-1-christianshewitt@gmail.com?part=1

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2026-06-27 13:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-27 13:12 Christian Hewitt
2026-06-27 13:24 ` sashiko-bot [this message]
2026-07-07 22:03 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260627132419.B377F1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=christianshewitt@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox