All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mohammad Rafi Shaik" <mohammad.rafi.shaik@oss.qualcomm.com>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v6 v6 8/9] ASoC: qcom: lpass-tx-macro: Add support for Bolero v4.0
Date: Fri, 06 Nov 2026 13:00:53 +0000	[thread overview]
Message-ID: <sashiko-outbox-201426@kernel.org> (raw)
In-Reply-To: <20261106-add_shikra_support-v6-8-2cda302237cc@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] ASoC: qcom: lpass-tx-macro: no-op ADPT disable in
  tx_macro_enable_dec()
- [Medium] ASoC: qcom: lpass-tx-macro: missing DAPM routes for
  RX_SWR_MIC in v15 map
- [Low] ASoC: qcom: lpass-tx-macro: mixing __free() with goto in
  tx_macro_probe()
- [Low] ASoC: qcom: lpass-tx-macro: stale REGCACHE_MAPLE claim in commit
  message
--

commit 359688a973454b992ccd5b2a57890a5f9b9973cf
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

ASoC: qcom: lpass-tx-macro: Add support for Bolero v4.0

This commit adds Bolero v4.0 TX macro support for Hawi, including register
defaults, regmap extensions, decimator and port-select DAPM widgets and
routes, and ADPT control disabling.

> Add the v4.0 register defaults and extend the regmap accessors and
> maximum register offset only for the v4.0 match data. Use REGCACHE_MAPLE
> for the TX macro regmap since the register defaults are sparse and the
> v4.0 layout extends the register range.

[Severity: Low]
This isn't a bug, but tx_regmap_config already switched to REGCACHE_MAPLE in
commit 8ed9306885eb ("ASoC: codecs: lpass-tx-macro: switch cache to
REGCACHE_MAPLE") and this patch does not change .cache_type.

> diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c
> index 6deaaabe43afa..6480a6c9032e3 100644
> --- a/sound/soc/codecs/lpass-tx-macro.c
> +++ b/sound/soc/codecs/lpass-tx-macro.c

[ ... ]

> @@ -434,6 +458,26 @@ static struct reg_default tx_defaults[] = {
>  	{ CDC_TX7_TX_PATH_SEC6, 0x00},
>  };
>  
> +static const struct reg_default tx_4_0_defaults[] = {
> +	{ CDC_TX_INP_MUX_ADC_MUX0_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX1_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX2_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX3_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX4_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX5_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX6_CFG2, 0x00},
> +	{ CDC_TX_INP_MUX_ADC_MUX7_CFG2, 0x00},
> +	{ CDC_TX0_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX1_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX2_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX3_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX4_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX5_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX6_TX_PATH_CFG2, 0x03},
> +	{ CDC_TX7_TX_PATH_CFG2, 0x03},
> +	{ CDC_ADPT0_ADPT_CTRL, 0x00},
> +};

[ ... ]

> @@ -929,6 +998,10 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w,
>  
>  	switch (event) {
>  	case SND_SOC_DAPM_PRE_PMU:
> +		/* Disable the ADPT block before enabling the decimator */
> +		if (tx->data->has_adpt)
> +			snd_soc_component_write_field(component, CDC_ADPT0_ADPT_CTRL,
> +						      CDC_TX_ADPT_CTRL_EN_MASK, 0x0);

[Severity: Medium]
Does snd_soc_component_write_field() ever write to CDC_ADPT0_ADPT_CTRL here?

tx_4_0_defaults initializes the non-volatile cache entry for
CDC_ADPT0_ADPT_CTRL to 0x00, and nothing in the driver ever writes a
non-zero value to it.  Both snd_soc_component_write_field() and
regcache_sync() see that the cached value already matches 0x00 and skip the
register write, leaving the ADPT block in its hardware reset state during
capture.  Should tx_4_0_defaults record the actual non-zero hardware reset
value of CDC_ADPT0_ADPT_CTRL (as lpass-va-macro.c does in va_4_1_defaults)?

[ ... ]

> @@ -2027,6 +2103,418 @@ static const struct snd_soc_dapm_route tx_audio_map_v9_2[] = {
>  	{"TX SMIC MUX7", "SWR_MIC11", "TX SWR_INPUT11"},
>  };
>  
> +static const char * const adc_mux_text_v9_3[] = {
> +	"MSM_DMIC", "SWR_MIC", "ANC_FB_TUNE1", "RX_SWR_MIC"
> +};

[ ... ]

> +static const struct snd_soc_dapm_route tx_audio_map_v15[] = {
> +	/* DEC0 */
> +	{"TX DEC0 MUX", "SWR_MIC", "TX SMIC MUX0"},

[Severity: Medium]
Are DAPM routes missing for the "RX_SWR_MIC" option in tx_audio_map_v15?

adc_mux_text_v9_3 adds "RX_SWR_MIC" to TX DEC0 MUX through TX DEC7 MUX, but
neither tx_audio_map nor tx_audio_map_v15 defines a route with the
"RX_SWR_MIC" control for any decimator.  When userspace selects "RX_SWR_MIC"
on a decimator mux, DAPM finds no connected input path, so the decimator
widget never powers up and tx_macro_enable_dec() is not called.

[ ... ]

> @@ -2250,6 +2751,9 @@ static int tx_macro_probe(struct platform_device *pdev)
>  	struct device_node *np = dev->of_node;
>  	struct tx_macro *tx;
>  	void __iomem *base;
> +	struct reg_default *reg_defaults __free(kfree) = NULL;
> +	struct regmap_config *reg_config __free(kfree) = NULL;
> +	size_t def_count;
>  	int ret, reg;
>  
>  	tx = devm_kzalloc(dev, sizeof(*tx), GFP_KERNEL);
> @@ -2304,7 +2808,40 @@ static int tx_macro_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	tx->regmap = devm_regmap_init_mmio(dev, base, &tx_regmap_config);
> +	reg_config = kmemdup(&tx_regmap_config, sizeof(*reg_config), GFP_KERNEL);
> +	if (!reg_config) {
> +		ret = -ENOMEM;
> +		goto err;
> +	}

[Severity: Low]
This isn't a bug, but tx_macro_probe() mixes __free(kfree) variables with
goto-based error handling and declares reg_config as NULL at the top of the
function instead of defining and initializing it at kmemdup().  Registering
lpass_macro_pds_exit_action() via devm_add_action_or_reset() (as
rx_macro_probe() does in sound/soc/codecs/lpass-rx-macro.c) would avoid
mixing __free() with goto err.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261106-add_shikra_support-v6-0-2cda302237cc@oss.qualcomm.com?part=8

  reply	other threads:[~2026-11-06 13:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 12:32 [PATCH v6 0/9] ASoC: qcom: Add shikra and Hawi LPASS macro support Mohammad Rafi Shaik
2026-11-06 12:33 ` [PATCH v6 v6 1/9] ASoC: dt-bindings: qcom: Add Shikra RX and VA macro codecs Mohammad Rafi Shaik
2026-11-06 12:33 ` [PATCH v6 v6 2/9] ASoC: qcom: lpass-macro-common: Add missing v2.9 version string Mohammad Rafi Shaik
2026-11-06 12:40   ` sashiko-bot
2026-11-06 12:33 ` [PATCH v6 v6 3/9] ASoC: qcom: lpass-rx-macro: Add shikra compatible Mohammad Rafi Shaik
2026-11-09 15:15   ` Srinivas Kandagatla
2026-11-12 10:09     ` Mohammad Rafi Shaik
2026-11-06 12:33 ` [PATCH v6 v6 4/9] ASoC: qcom: lpass-va-macro: " Mohammad Rafi Shaik
2026-11-06 12:46   ` sashiko-bot
2026-11-11  1:20   ` Mark Brown
2026-11-12 10:17     ` Mohammad Rafi Shaik
2026-11-12 10:20       ` Mohammad Rafi Shaik
2026-11-06 12:33 ` [PATCH v6 v6 5/9] ASoC: qcom: lpass-va-macro: Add SoundWire microphone support Mohammad Rafi Shaik
2026-11-06 12:55   ` sashiko-bot
2026-11-09 15:23   ` Srinivas Kandagatla
2026-11-06 12:33 ` [PATCH v6 v6 6/9] ASoC: dt-bindings: qcom: Add Hawi LPASS macro codecs Mohammad Rafi Shaik
2026-11-10  8:39   ` Krzysztof Kozlowski
2026-11-06 12:33 ` [PATCH v6 v6 7/9] ASoC: dt-bindings: qcom: Add Maili " Mohammad Rafi Shaik
2026-11-09 11:40   ` Krzysztof Kozlowski
2026-11-06 12:33 ` [PATCH v6 v6 8/9] ASoC: qcom: lpass-tx-macro: Add support for Bolero v4.0 Mohammad Rafi Shaik
2026-11-06 13:00   ` sashiko-bot [this message]
2026-11-11  1:20   ` Mark Brown
2026-11-06 12:33 ` [PATCH v6 v6 9/9] ASoC: qcom: lpass: Add support for LPASS codec v4.0 Mohammad Rafi Shaik
2026-11-09 15:02   ` Srinivas Kandagatla
2026-11-12 11:50     ` Prasad Kumpatla

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=sashiko-outbox-201426@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-sound@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.