From: sashiko-bot@kernel.org
To: "Richard Acayan" <mailingradian@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 06/15] ASoC: qdsp6: q6dsp-lpass-ports: add support for lpi mi2s ports 5-6
Date: Tue, 09 Jun 2026 16:50:49 +0000 [thread overview]
Message-ID: <20260609165049.7948F1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609162255.31074-7-mailingradian@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Global singleton DAI array `q6dsp_audio_fe_dais` is unsafely modified, leading to cross-driver type confusion if multiple front-ends probe.
--
commit 4aa03981f3bbeea9a8f5b00fc98ab94eec2d0492
Author: Richard Acayan <mailingradian@gmail.com>
ASoC: qdsp6: q6dsp-lpass-ports: add support for lpi mi2s ports 5-6
Add the extra LPI MI2S ports used for internal MI2S on SDM660.
Link: https://android.googlesource.com/kernel/msm-extra/+/530cffa4cc977a348753831b163eb9d3302b954a/asoc/msm-dai-q6-v2.c#4597
> diff --git a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c b/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c
> index e5cd82f77b552..c3d8116ad5035 100644
> --- a/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c
> +++ b/sound/soc/qcom/qdsp6/q6dsp-lpass-ports.c
[ ... ]
> @@ -712,6 +716,7 @@ struct snd_soc_dai_driver *q6dsp_audio_ports_set_config(struct device *dev,
> case QUINARY_MI2S_RX ... QUINARY_MI2S_TX:
> case PRIMARY_MI2S_RX ... QUATERNARY_MI2S_TX:
> case LPI_MI2S_RX_0 ... LPI_MI2S_TX_4:
> + case LPI_MI2S_RX_5 ... LPI_MI2S_TX_6:
> q6dsp_audio_fe_dais[i].ops = cfg->q6i2s_ops;
[Severity: High]
This is a pre-existing issue, but adding new ports to this switch block
highlights a potential problem with how q6dsp_audio_fe_dais is handled.
Since q6dsp_audio_ports_set_config() modifies the ops pointers of the
global static q6dsp_audio_fe_dais array in-place, does this create a risk
if multiple audio components that use this shared library probe on the
same system?
If a second component probes, wouldn't it overwrite the ops pointers for
all DAIs globally? Because ALSA stores a direct pointer to elements of
this array during component registration via devm_snd_soc_register_component(),
it seems the DAI callbacks for the first component could end up being
executed by the second component's driver.
Could this cause cross-driver type confusion where a callback casts
dev_get_drvdata(dai->dev) to its own driver data struct, but actually
operates on the other component's data (like expecting q6apm_lpass_dai_data
but getting q6afe_dai_data), potentially leading to memory corruption?
> break;
> case PRIMARY_TDM_RX_0 ... QUINARY_TDM_TX_7:
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609162255.31074-1-mailingradian@gmail.com?part=6
next prev parent reply other threads:[~2026-06-09 16:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 16:22 [PATCH v5 00/15] SDM660 sound card and internal MI2S support Richard Acayan
2026-06-09 16:22 ` [PATCH v5 01/15] ASoC: dt-bindings: qcom,sm8250: add compatible for sdm660 Richard Acayan
2026-06-09 16:22 ` [PATCH v5 02/15] ASoC: dt-bindings: qcom: q6dsp: add support for lpi mi2s ports 5-6 Richard Acayan
2026-06-09 16:22 ` [PATCH v5 03/15] ASoC: dt-bindings: pm8916-wcd-analog-codec: Document pm8950/pm8953 Richard Acayan
2026-06-09 16:22 ` [PATCH v5 04/15] ASoC: dt-bindings: pm8916-analog-codec: Add PM660L compatible Richard Acayan
2026-06-09 16:22 ` [PATCH v5 05/15] ASoC: dt-bindings: msm8916-digital-codec: Add SDM660 compatible Richard Acayan
2026-06-09 16:22 ` [PATCH v5 06/15] ASoC: qdsp6: q6dsp-lpass-ports: add support for lpi mi2s ports 5-6 Richard Acayan
2026-06-09 16:50 ` sashiko-bot [this message]
2026-06-09 16:22 ` [PATCH v5 07/15] ASoC: qdsp6: q6afe: add internal mi2s support Richard Acayan
2026-06-09 16:22 ` [PATCH v5 08/15] ASoC: qdsp6: q6afe-dai: " Richard Acayan
2026-06-09 16:22 ` [PATCH v5 09/15] ASoC: qdsp6: q6routing: add lpi " Richard Acayan
2026-06-09 16:22 ` [PATCH v5 10/15] ASoC: qdsp6: common: support headphone jacks connected to lpi mi2s Richard Acayan
2026-06-09 16:22 ` [PATCH v5 11/15] ASoC: qcom: sm8250: add support for LPI_MI2S_RX_0 and LPI_MI2S_TX_3 Richard Acayan
2026-06-09 16:43 ` sashiko-bot
2026-06-09 16:22 ` [PATCH v5 12/15] ASoC: qcom: sm8250: add SDM660 compatible Richard Acayan
2026-06-09 16:38 ` sashiko-bot
2026-06-09 16:22 ` [PATCH v5 13/15] ASoC: msm8916-wcd-analog: add pm8950 codec Richard Acayan
2026-06-09 16:48 ` sashiko-bot
2026-06-09 16:22 ` [PATCH v5 14/15] ASoC: msm8916-wcd-analog: add pm8953 codec Richard Acayan
2026-06-09 16:22 ` [PATCH v5 15/15] ASoC: msm8916-wcd-analog: add quirk for cajon 2.0 Richard Acayan
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=20260609165049.7948F1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=mailingradian@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox