From: sashiko-bot@kernel.org
To: "Mohammad Rafi Shaik" <mohammad.rafi.shaik@oss.qualcomm.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 v3 5/5] ASoC: qcom: lpass-va-macro: Add SoundWire microphone mux support
Date: Thu, 17 Sep 2026 02:25:43 +0000 [thread overview]
Message-ID: <20260917022543.B7D3F1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260917-add_shikra_support-v3-5-fc0e79c341aa@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ASoC: lpass-va-macro: hardware state clobbering in va_macro_put_dec_enum()
--
commit a5472bf1265a3738d3abbcf9b151ff9456f2a107
Author: Mohammad Rafi Shaik <mohammad.rafi.shaik@oss.qualcomm.com>
ASoC: qcom: lpass-va-macro: Add SoundWire microphone mux support
This commit adds support for routing audio from SoundWire microphone (SMIC)
inputs for VA decimators. It updates the decimator source selection logic
and skips DMIC-specific HPF programming when using an SMIC source.
> diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
> index 31d399dfa8bcf..50673b012c16a 100644
> --- a/sound/soc/codecs/lpass-va-macro.c
> +++ b/sound/soc/codecs/lpass-va-macro.c
> @@ -758,10 +758,22 @@ static int va_macro_put_dec_enum(struct snd_kcontrol *kcontrol,
> return -EINVAL;
> }
>
> - if (val != 0)
> - snd_soc_component_update_bits(component, mic_sel_reg,
> - CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK,
> - CDC_VA_TX_PATH_ADC_DMIC_SEL_DMIC);
> + if (val != 0) {
> + /*
> + * SMIC enums use shift 0 (lower nibble of CFG0),
> + * DMIC enums use shift 4 (upper nibble of CFG0).
> + * Use e->shift_l to distinguish them without relying
> + * on widget name comparisons.
> + */
> + if (e->shift_l == 0)
> + snd_soc_component_update_bits(component, mic_sel_reg,
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK,
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_ADC);
> + else
> + snd_soc_component_update_bits(component, mic_sel_reg,
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_MASK,
> + CDC_VA_TX_PATH_ADC_DMIC_SEL_DMIC);
[Severity: High]
Does this code improperly clobber the hardware state during user-space mixer
control writes, causing it to become desynchronized from the DAPM routing
graph?
Because va_macro_put_dec_enum() immediately updates the
CDC_VA_TX_PATH_ADC_DMIC_SEL hardware bit based on the sub-mux being written,
writing to an inactive SMIC mux will clobber the hardware bit to ADC, even if
the actual active path (determined by VA DEC MUX) is set to DMIC. Whichever
sub-mux control is written last wins the hardware state.
This appears to cause the audio capture path to randomly break when ALSA mixer
controls are initialized or restored (e.g., via alsactl restore).
> + }
>
> return snd_soc_dapm_put_enum_double(kcontrol, ucontrol);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-add_shikra_support-v3-0-fc0e79c341aa@oss.qualcomm.com?part=5
prev parent reply other threads:[~2026-09-17 2:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 2:15 [PATCH v3 0/5] ASoC: qcom: Add shikra LPASS RX/VA macro support Mohammad Rafi Shaik
2026-09-17 2:15 ` [PATCH v3 v3 1/5] ASoC: dt-bindings: qcom: Add Shikra RX and VA macro codecs Mohammad Rafi Shaik
2026-09-17 2:15 ` [PATCH v3 v3 2/5] ASoC: qcom: lpass-macro-common: Add missing v2.9 version string Mohammad Rafi Shaik
2026-09-17 2:15 ` [PATCH v3 v3 3/5] ASoC: qcom: lpass-rx-macro: Add shikra compatible Mohammad Rafi Shaik
2026-09-17 2:15 ` [PATCH v3 v3 4/5] ASoC: qcom: lpass-va-macro: " Mohammad Rafi Shaik
2026-09-17 2:26 ` sashiko-bot
2026-09-17 2:15 ` [PATCH v3 v3 5/5] ASoC: qcom: lpass-va-macro: Add SoundWire microphone mux support Mohammad Rafi Shaik
2026-09-17 2:25 ` sashiko-bot [this message]
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=20260917022543.B7D3F1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=mohammad.rafi.shaik@oss.qualcomm.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