From: sashiko-bot@kernel.org
To: "Binbin Zhou" <zhoubinbin@loongson.cn>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 4/9] ASoC: dt-bindings: loongson,ls-audio-card: Use common sound card
Date: Fri, 26 Jun 2026 02:37:51 +0000 [thread overview]
Message-ID: <20260626023751.670D51F000E9@smtp.kernel.org> (raw)
In-Reply-To: <fa72a429a9d076d381f7d514184f19d5a35ffa51.1782439646.git.zhoubinbin@loongson.cn>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
Pre-existing issues:
- [High] Global state corruption via in-place modification of static DAI links array and codec string buffer.
- [High] Sysfs and ASoC component name collision via illegal `dev_set_name` override during probe.
- [High] Bitwise read-modify-write bug without clearing target bitfields causes incorrect APB DMA routing.
--
commit 864c9404304a7ef17062fbe81f6d13b229c50a0d
Author: Binbin Zhou <zhoubinbin@loongson.cn>
Subject: ASoC: dt-bindings: loongson,ls-audio-card: Use common sound card
This commit updates the loongson,ls-audio-card binding to reference the common
sound card schema. It removes the user specified model property and
transitions to evaluating additional properties via unevaluatedProperties.
> diff --git a/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml b/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
> index 61e8babed402f..e1b7445a8b22f 100644
> --- a/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
> +++ b/Documentation/devicetree/bindings/sound/loongson,ls-audio-card.yaml
[ ... ]
While reviewing the related sound driver for this binding, I noticed a few
pre-existing items in the driver code.
[Severity: High]
This is a pre-existing issue, but I noticed a potential problem in the
sound card driver when handling multiple instances.
In sound/soc/loongson/loongson_card.c:loongson_card_parse_acpi():
loongson_dai_links[i].platforms->name = dev_name(phy_dev);
loongson_dai_links[i].codecs->name = codec_name;
loongson_dai_links[i].codecs->dai_name = codec_dai_name;
And similarly in sound/soc/loongson/loongson_card.c:loongson_card_parse_of():
ret = snd_soc_of_get_dlc(cpu, NULL, loongson_dai_links[i].cpus, 0);
...
loongson_dai_links[i].platforms->of_node =
loongson_dai_links[i].cpus->of_node;
ret = snd_soc_of_get_dlc(codec, NULL, loongson_dai_links[i].codecs, 0);
Will this corrupt the shared static loongson_dai_links array if multiple
sound cards are instantiated via the device tree or ACPI tables?
If multiple instances are probed, they might overwrite each other's
DAI links and codec strings. Should these structures be dynamically
allocated instead of mutating shared static memory?
[Severity: High]
This is a pre-existing issue, but there might be a sysfs naming collision
in the I2S platform driver.
In sound/soc/loongson/loongson_i2s_plat.c:loongson_i2s_plat_probe():
dev_set_name(dev, LS_I2S_DRVNAME);
Could this override cause duplicate ASoC component names if multiple I2S
controllers are instantiated in the device tree?
Calling dev_set_name during probe after the device is added to sysfs might
break internal kernel tracking and cause probe failures for subsequent
instances.
[Severity: High]
This is a pre-existing issue, but there appears to be a bitwise
read-modify-write problem in the APB DMA configuration.
In sound/soc/loongson/loongson_i2s_plat.c:loongson_i2s_apbdma_config():
val |= LOONGSON_DMA2_CONF << LOONGSON_I2S_TX_DMA_OFFSET;
val |= LOONGSON_DMA3_CONF << LOONGSON_I2S_RX_DMA_OFFSET;
Does this code correctly handle cases where the bootloader or previous
firmware left the DMA configuration register in a non-zero state?
Since LOONGSON_DMA2_CONF occupies multiple bits, if other bits are
already set, the bitwise OR will blend the values instead of strictly
setting the field.
Should the target bitfields be cleared via a bitwise AND mask before
applying the new configuration?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1782439646.git.zhoubinbin@loongson.cn?part=4
next prev parent reply other threads:[~2026-06-26 2:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 2:27 [PATCH v3 0/9] ASoC: Add Loongson-2K0300 I2S controller and sound card support Binbin Zhou
2026-06-26 2:27 ` [PATCH v3 1/9] ASoC: loongson: Fix error handling in ACPI property parsing Binbin Zhou
2026-06-26 2:38 ` sashiko-bot
2026-06-26 2:27 ` [PATCH v3 2/9] ASoC: dt-bindings: loongson,ls2k1000-i2s: Document Loongson-2K0300 compatible Binbin Zhou
2026-06-26 2:27 ` [PATCH v3 3/9] ASoC: loongson: Add Loongson-2K0300 I2S controller support Binbin Zhou
2026-06-26 2:37 ` sashiko-bot
2026-06-26 2:27 ` [PATCH v3 4/9] ASoC: dt-bindings: loongson,ls-audio-card: Use common sound card Binbin Zhou
2026-06-26 2:37 ` sashiko-bot [this message]
2026-06-26 2:27 ` [PATCH v3 5/9] ASoC: dt-bindings: loongson,ls-audio-card: Add ctcisz forever pi compatible Binbin Zhou
2026-06-26 2:27 ` [PATCH v3 6/9] ASoC: loongson: Add Loongson-2K0300 CTCISZ Forever Pi sound card support Binbin Zhou
2026-06-26 2:38 ` sashiko-bot
2026-06-26 2:27 ` [PATCH v3 7/9] ASoC: dt-bindings: loongson,ls-audio-card: Add ATK-DL2K0300B compatible Binbin Zhou
2026-06-26 2:38 ` sashiko-bot
2026-06-26 2:27 ` [PATCH v3 8/9] ASoC: loongson: Add headphone jack detection and DAPM routing Binbin Zhou
2026-06-26 2:44 ` sashiko-bot
2026-06-26 2:27 ` [PATCH v3 9/9] ASoC: es8328: Add DAPM routes from MIC inputs to Mic Bias Binbin Zhou
2026-06-26 2:40 ` sashiko-bot
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=20260626023751.670D51F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=zhoubinbin@loongson.cn \
/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