From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Zimeng Li <me@lizi.moe>, srini@kernel.org, broonie@kernel.org
Cc: lgirdwood@gmail.com, tiwai@suse.com, linux-sound@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] ASoC: qcom: lpass-cpu: use DAI table index for playback constraints
Date: Sun, 20 Sep 2026 17:05:48 +0100 [thread overview]
Message-ID: <393a1343-cef7-4fe2-8236-8946185bb394@oss.qualcomm.com> (raw)
In-Reply-To: <20260920145848.44521-1-me@lizi.moe>
On 9/20/26 3:58 PM, Zimeng Li wrote:
> The DAI ID is a hardware port ID and is not necessarily the index of
> the corresponding entry in variant->dai_driver.
>
> When configuring a DAI with LPAIF_I2SCTL_MODE_QUAD01, the probe code
> currently uses dai_id to index variant->dai_driver. This is incorrect
> for platforms where DAI IDs are sparse. For example, the IPQ806x MI2S
> DAI has ID 4 while it is the only entry in the DAI driver table, so
> the current code accesses dai_driver[4] instead of the DAI being
> processed.
This looks like a bug, however the code has been written in assumption
that the dai_drive.
That also raises the question that was this patch actually tested on any
hardware?
>
> Use the loop index i when updating the current DAI's playback channel
> constraints, while retaining dai_id for indexing the hardware-port
> specific playback SD-line mode array.
>
> This fixes the incorrect DAI table access for platforms where the DAI
> ID does not match its position in the driver table.
>
> Fixes: c223f41c1a52 ("ASoC: qcom: Add four speaker support on MI2S secondary")
Cc Stable ?
> Signed-off-by: Zimeng Li <me@lizi.moe>
> Assisted-by: LLM
Can you please add the actual model name as others do.
> ---
> Compile-tested with LLVM for ARM using multi_v7_defconfig with
> CONFIG_SND_SOC_STORM=m. The lpass-cpu.o, lpass-ipq806x.o and
> lpass-platform.o targets built successfully. Not hardware-tested;
> the IPQ806x example is based on static analysis, not a reproduced crash.
>
> sound/soc/qcom/lpass-cpu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index 242bc16da..079177a6d 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
> @@ -1234,8 +1234,8 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
> }
> if (drvdata->mi2s_playback_sd_mode[dai_id] ==
> LPAIF_I2SCTL_MODE_QUAD01) {
> - variant->dai_driver[dai_id].playback.channels_min = 4;
> - variant->dai_driver[dai_id].playback.channels_max = 4;
> + variant->dai_driver[i].playback.channels_min = 4;
> + variant->dai_driver[i].playback.channels_max = 4;
> }
> }
>
>
> base-commit: 0ed6f7f62318a581fe9698f8a4e98c7ca01160e4
next prev parent reply other threads:[~2026-09-20 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 14:58 [PATCH] ASoC: qcom: lpass-cpu: use DAI table index for playback constraints Zimeng Li
2026-09-20 16:05 ` Srinivas Kandagatla [this message]
2026-09-20 19:33 ` Zimeng Li
2026-09-21 13:10 ` Mark Brown
2026-09-20 19:38 ` [PATCH v2] " Zimeng Li
2026-09-21 8:27 ` Mark Brown
2026-09-21 9:46 ` Li Tadokoro
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=393a1343-cef7-4fe2-8236-8946185bb394@oss.qualcomm.com \
--to=srinivas.kandagatla@oss.qualcomm.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=me@lizi.moe \
--cc=srini@kernel.org \
--cc=tiwai@suse.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