From: sashiko-bot@kernel.org
To: "Valerio Setti" <vsetti@baylibre.com>
Cc: neil.armstrong@linaro.org, linux-amlogic@lists.infradead.org
Subject: Re: [PATCH 1/2] ASoC: meson: gx-formatter: prepare on attach
Date: Thu, 02 Jul 2026 11:10:20 +0000 [thread overview]
Message-ID: <20260702111021.2CCDC1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260702-fix-24-bit-i2s-playback-v1-1-bcd3a43fe32a@baylibre.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Moving formatter prepare logic to the DAPM PRE_PMU event breaks hardware reconfiguration for back-to-back playbacks or rapid restarts.
--
commit 0be8c647d2188e02c8519d4d117bc9cb1bdb746c
Author: Valerio Setti <vsetti@baylibre.com>
ASoC: meson: gx-formatter: prepare on attach
This commit splits the prepare and enable operations for the formatter
driver. It moves the prepare operation to happen when the widget is powered
up rather than at trigger time, aiming to resolve 24-bit I2S playback
corruption caused by pipeline reset ordering conflicts.
> diff --git a/sound/soc/meson/gx-formatter.c b/sound/soc/meson/gx-formatter.c
> index 311e63affb239..c7333f624b155 100644
> --- a/sound/soc/meson/gx-formatter.c
> +++ b/sound/soc/meson/gx-formatter.c
[ ... ]
> -static int gx_formatter_enable(struct gx_formatter *formatter)
> +static int gx_formatter_prepare(struct gx_formatter *formatter)
> {
> int ret;
>
> - /* Do nothing if the formatter is already enabled */
> - if (formatter->enabled)
> + if (formatter->prepared)
> return 0;
[Severity: High]
Will this prevent hardware reconfiguration for back-to-back playbacks?
Because the ALSA core utilizes pmdown_time (delayed power down), the DAPM
widget remains in the powered-on state for a short time after playback
stops.
If a new stream with different parameters (e.g., changing from 16-bit to
24-bit) starts rapidly before the power-down occurs, dapm_power_widgets()
will not detect a power state change and will not emit a new
SND_SOC_DAPM_PRE_PMU event.
Since the widget wasn't powered down, gx_formatter_detach() hasn't cleared
formatter->prepared. This check will return early and skip updating the
hardware for the new sample format, causing the new stream to play through
incorrectly configured hardware.
>
> /* Setup the stream parameter in the formatter */
> if (formatter->drv->ops->prepare) {
> ret = formatter->drv->ops->prepare(formatter->map,
> - formatter->drv->quirks,
> - formatter->stream);
> + formatter->drv->quirks,
> + formatter->stream);
> if (ret)
> return ret;
> }
[ ... ]
> @@ -63,6 +74,12 @@ static int gx_formatter_attach(struct gx_formatter *formatter)
>
> mutex_lock(&ts->lock);
>
> + ret = gx_formatter_prepare(formatter);
> + if (ret) {
> + pr_err("failed to prepare the formatter\n");
> + goto out;
> + }
> +
> /* Catch up if the stream is already running when we attach */
> if (ts->ready) {
> ret = gx_formatter_enable(formatter);
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260702-fix-24-bit-i2s-playback-v1-0-bcd3a43fe32a@baylibre.com?part=1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-07-02 11:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 10:56 [PATCH 0/2] ASoC: meson: aiu: fix playback issue for 24-bit mode Valerio Setti
2026-07-02 10:56 ` [PATCH 1/2] ASoC: meson: gx-formatter: prepare on attach Valerio Setti
2026-07-02 11:10 ` sashiko-bot [this message]
2026-07-02 20:34 ` Valerio Setti
2026-07-03 7:34 ` Jerome Brunet
2026-07-02 10:56 ` [PATCH 2/2] ASoC: meson: aiu-formatter: remove pipeline reset from prepare Valerio Setti
2026-07-02 11:14 ` sashiko-bot
2026-07-02 20:44 ` Valerio Setti
2026-07-03 7:58 ` Jerome Brunet
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=20260702111021.2CCDC1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vsetti@baylibre.com \
/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