All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Neo Chang" <YLCHANG2@nuvoton.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 1/2] ASoC: codecs: nau8360: Block DSP path selection when firmware load fails
Date: Mon, 14 Sep 2026 02:11:37 +0000	[thread overview]
Message-ID: <20260914021137.9B54F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260914015648.311986-2-YLCHANG2@nuvoton.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing `flush_work()` causes `alsactl` state restoration to sporadically fail on boot.
--

commit f48ac064e0d2cdb72be2043789666477aed5f727
Author: Neo Chang <YLCHANG2@nuvoton.com>

ASoC: codecs: nau8360: Block DSP path selection when firmware load fails

Block the DSP path selection if the firmware fails to load to prevent
invalid routing states.

If the firmware is not ready, nau8360_dac_mux_put_enum() will print
a rate-limited warning and return -EBUSY. This rejects the invalid
userspace request and maintains the original hardware state without
causing audio wrong status.

Closes: https://lore.kernel.org/linux-sound/aqK_oOpMAXVhxkHJ@stanley.mountain/

> diff --git a/sound/soc/codecs/nau8360.c b/sound/soc/codecs/nau8360.c
> index 89b8ee80d6c86..f5dee12127cd0 100644
> --- a/sound/soc/codecs/nau8360.c
> +++ b/sound/soc/codecs/nau8360.c
> @@ -715,8 +715,13 @@ static int nau8360_dac_mux_put_enum(struct snd_kcontrol *kcontrol,
>  	int ret = 0;
>  
>  	if (snd_soc_dapm_get_bias_level(dapm) > SND_SOC_BIAS_STANDBY) {
> -		dev_warn(nau8360->dev, "changing path is not allowed during playback");
> -		return ret;
> +		dev_warn_ratelimited(nau8360->dev, "changing path is not allowed during playback");
> +		return -EBUSY;
> +	}
> +
> +	if (item[0] == NAU8360_DAC_SRC_DSP && !nau8360->load_fw_done) {
> +		dev_warn_ratelimited(nau8360->dev, "Cannot enable DSP: Firmware not ready or disabled\n");
> +		return -EBUSY;

[Severity: Medium]
Will this cause boot-time ALSA state restoration to fail if the asynchronous
firmware loader is still running?

Userspace initialization tools like alsactl restore write to ALSA controls
immediately after card registration during boot. Because nau8360_load_fw_work
is scheduled asynchronously, nau8360->load_fw_done might still be false when
alsactl attempts to restore the DSP path.

Without a flush_work() call to synchronize with the firmware loader, does this
mean valid DSP routing configurations saved by the user will be sporadically
rejected during boot, causing the audio state to fall back to the default HW1
path?

>  	}
>  
>  	mutex_lock(&nau8360->lock);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914015648.311986-1-YLCHANG2@nuvoton.com?part=1

  reply	other threads:[~2026-09-14  2:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14  1:56 [PATCH v5 0/2] ASoC: codecs: nau8360: Fix DSP routing and deadlock issues Neo Chang
2026-09-14  1:56 ` [PATCH v5 1/2] ASoC: codecs: nau8360: Block DSP path selection when firmware load fails Neo Chang
2026-09-14  2:11   ` sashiko-bot [this message]
2026-09-14  1:56 ` [PATCH v5 2/2] ASoC: codecs: nau8360: Fix AB-BA deadlock in mux update Neo Chang
2026-09-14 11:03 ` [PATCH v5 0/2] ASoC: codecs: nau8360: Fix DSP routing and deadlock issues Mark Brown
2026-09-17 11:47 ` 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=20260914021137.9B54F1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=YLCHANG2@nuvoton.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.