From: sashiko-bot@kernel.org
To: "Valerio Setti" <vsetti@baylibre.com>
Cc: conor+dt@kernel.org, robh@kernel.org,
linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org,
neil.armstrong@linaro.org
Subject: Re: [PATCH v3 4/7] ASoC: meson: add AUDIN driver
Date: Tue, 22 Sep 2026 16:17:10 +0000 [thread overview]
Message-ID: <20260922161711.596B61F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922-audin-v3-4-a760312c076c@baylibre.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] sound: soc: meson: data race due to global state modification in probe
--
commit 19f0be491d181acce1da0bdd85fd37b9549fa25c
Author: Valerio Setti <vsetti@baylibre.com>
ASoC: meson: add AUDIN driver
This commit adds the AUDIN driver to provide audio input support for Amlogic
GX based platforms. It incorporates FIFO handling and an I2S data formatter to
route audio streams.
> diff --git a/sound/soc/meson/audin.c b/sound/soc/meson/audin.c
> new file mode 100644
> index 0000000000000..15824354abede
> --- /dev/null
> +++ b/sound/soc/meson/audin.c
[ ... ]
> +static struct snd_soc_dapm_widget audin_dapm_widgets[] = {
> + [AUDIN_WIDGET_I2S_FORMATTER] =
> + SND_SOC_DAPM_PGA_E("I2S Formatter", SND_SOC_NOPM, 0, 0, NULL, 0,
> + gx_formatter_event,
> + (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD)),
> + SND_SOC_DAPM_MUX("FIFO0 SRC SEL", SND_SOC_NOPM, 0, 0,
> + &audin_fifo0_input_sel_mux),
[ ... ]
> +static int audin_probe(struct platform_device *pdev)
> +{
[ ... ]
> + ret = gx_formatter_create(dev, &audin_dapm_widgets[AUDIN_WIDGET_I2S_FORMATTER],
> + &audin_formatter_i2s_drv, regmap);
[Severity: Low]
Is it safe to mutate the static audin_dapm_widgets array here in audin_probe()
with a per-device allocated pointer?
Calling gx_formatter_create() modifies w->priv where w points to the static
global audin_dapm_widgets array.
While ASoC's snd_soc_dapm_new_controls() uses kmemdup() to clone widget
templates, modifying shared static global structs without synchronization
introduces a structural data race if multiple instances are probed
concurrently. This also appears to violate driver design principles against
modifying static templates.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260922-audin-v3-0-a760312c076c@baylibre.com?part=4
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2026-09-22 16:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 16:00 [PATCH v3 0/7] ASoC: meson: gx: add base support for I2S audio input Valerio Setti
2026-09-22 16:00 ` [PATCH v3 1/7] ASoC: dt-bindings: amlogic,gx-audin: add schema Valerio Setti
2026-09-22 16:00 ` [PATCH v3 2/7] ASoC: meson: build gx-formatter as a separate module Valerio Setti
2026-09-22 16:00 ` [PATCH v3 3/7] ASoC: meson: aiu-encoder-i2s: ensure clk divider gets disabled in hw_free Valerio Setti
2026-09-22 16:00 ` [PATCH v3 4/7] ASoC: meson: add AUDIN driver Valerio Setti
2026-09-22 16:17 ` sashiko-bot [this message]
2026-09-22 16:00 ` [PATCH v3 5/7] ASoC: meson: aiu: add I2S Capture DAI Valerio Setti
2026-09-22 16:15 ` sashiko-bot
2026-09-22 16:00 ` [PATCH v3 6/7] ASoC: meson: gx-card: add support for audin FIFO Valerio Setti
2026-09-22 16:00 ` [PATCH v3 7/7] arm64: dts: amlogic: gx: add AUDIN node Valerio Setti
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=20260922161711.596B61F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=neil.armstrong@linaro.org \
--cc=robh@kernel.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
all inboxes | Powered by JetHome®