Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: codecs: lpass-{wsa,va}-macro: check clk_set_rate() return value
@ 2026-07-15  8:29 Ajay Kumar Nandam
  2026-07-15  8:29 ` [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: " Ajay Kumar Nandam
  2026-07-15  8:29 ` [PATCH 2/2] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
  0 siblings, 2 replies; 8+ messages in thread
From: Ajay Kumar Nandam @ 2026-07-15  8:29 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, Ajay Kumar Nandam

clk_set_rate() returns 0 on success or a negative errno on failure but
the WSA and VA macro probe functions were ignoring it. This series adds
return value checking and bails out of probe on failure.

This mirrors the same fix already posted for the TX and RX macros [1].

[1] https://lore.kernel.org/all/20260707-xo-sd-codec-tx-rx-v2-3-f61b4622f97f@oss.qualcomm.com/

Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
---
Ajay Kumar Nandam (2):
      ASoC: codecs: lpass-wsa-macro: check clk_set_rate() return value
      ASoC: codecs: lpass-va-macro: check clk_set_rate() return value

 sound/soc/codecs/lpass-va-macro.c  | 8 ++++++--
 sound/soc/codecs/lpass-wsa-macro.c | 9 +++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)
---
base-commit: cc2b5f627e8ccbae1188ef2d8be3e451d7f933a5
change-id: 20260715-xo-sd-codec-wsa-va-clk-set-rate-1f66a64165b9

Best regards,
--  
Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: check clk_set_rate() return value
  2026-07-15  8:29 [PATCH 0/2] ASoC: codecs: lpass-{wsa,va}-macro: check clk_set_rate() return value Ajay Kumar Nandam
@ 2026-07-15  8:29 ` Ajay Kumar Nandam
  2026-07-15  9:33   ` Cezary Rojewski
  2026-07-15 10:06   ` Konrad Dybcio
  2026-07-15  8:29 ` [PATCH 2/2] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
  1 sibling, 2 replies; 8+ messages in thread
From: Ajay Kumar Nandam @ 2026-07-15  8:29 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, Ajay Kumar Nandam

clk_set_rate() returns 0 on success or a negative errno on failure but
the WSA macro probe function was ignoring it. Check the return value and
bail out of probe on failure.

Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
---
 sound/soc/codecs/lpass-wsa-macro.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index f511816aa4a0..fc9e0a37c042 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -2773,8 +2773,13 @@ static int wsa_macro_probe(struct platform_device *pdev)
 	wsa->dev = dev;
 
 	/* set MCLK and NPL rates */
-	clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
-	clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
+	ret = clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
+	if (ret)
+		return ret;
+
+	ret = clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
+	if (ret)
+		return ret;
 
 	ret = devm_pm_clk_create(dev);
 	if (ret)

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] ASoC: codecs: lpass-va-macro: check clk_set_rate() return value
  2026-07-15  8:29 [PATCH 0/2] ASoC: codecs: lpass-{wsa,va}-macro: check clk_set_rate() return value Ajay Kumar Nandam
  2026-07-15  8:29 ` [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: " Ajay Kumar Nandam
@ 2026-07-15  8:29 ` Ajay Kumar Nandam
  2026-07-15  9:35   ` Cezary Rojewski
  2026-07-15 10:06   ` Konrad Dybcio
  1 sibling, 2 replies; 8+ messages in thread
From: Ajay Kumar Nandam @ 2026-07-15  8:29 UTC (permalink / raw)
  To: Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel, Ajay Kumar Nandam

clk_set_rate() returns 0 on success or a negative errno on failure but
the VA macro probe function was ignoring it. Check the return value and
bail out of probe on failure.

Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
---
 sound/soc/codecs/lpass-va-macro.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/lpass-va-macro.c b/sound/soc/codecs/lpass-va-macro.c
index 946051698420..dbc5795b9273 100644
--- a/sound/soc/codecs/lpass-va-macro.c
+++ b/sound/soc/codecs/lpass-va-macro.c
@@ -1605,7 +1605,9 @@ static int va_macro_probe(struct platform_device *pdev)
 	va->has_npl_clk = data->has_npl_clk;
 
 	/* mclk rate */
-	clk_set_rate(va->mclk, 2 * VA_MACRO_MCLK_FREQ);
+	ret = clk_set_rate(va->mclk, 2 * VA_MACRO_MCLK_FREQ);
+	if (ret)
+		goto err;
 
 	if (va->has_npl_clk) {
 		va->npl = devm_clk_get(dev, "npl");
@@ -1614,7 +1616,9 @@ static int va_macro_probe(struct platform_device *pdev)
 			goto err;
 		}
 
-		clk_set_rate(va->npl, 2 * VA_MACRO_MCLK_FREQ);
+		ret = clk_set_rate(va->npl, 2 * VA_MACRO_MCLK_FREQ);
+		if (ret)
+			goto err;
 	}
 
 	ret = devm_pm_clk_create(dev);

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: check clk_set_rate() return value
  2026-07-15  8:29 ` [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: " Ajay Kumar Nandam
@ 2026-07-15  9:33   ` Cezary Rojewski
  2026-07-15 12:21     ` Ajay Kumar Nandam
  2026-07-15 10:06   ` Konrad Dybcio
  1 sibling, 1 reply; 8+ messages in thread
From: Cezary Rojewski @ 2026-07-15  9:33 UTC (permalink / raw)
  To: Ajay Kumar Nandam
  Cc: linux-sound, linux-arm-msm, linux-kernel, Srinivas Kandagatla,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On 7/15/2026 10:29 AM, Ajay Kumar Nandam wrote:
> clk_set_rate() returns 0 on success or a negative errno on failure but
> the WSA macro probe function was ignoring it. Check the return value and

_is_ ignoring it. s/was/is/.

A patch is a proposal, there is no "was" until it is merged.

> bail out of probe on failure.
> 
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> ---
>   sound/soc/codecs/lpass-wsa-macro.c | 9 +++++++--
>   1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
> index f511816aa4a0..fc9e0a37c042 100644
> --- a/sound/soc/codecs/lpass-wsa-macro.c
> +++ b/sound/soc/codecs/lpass-wsa-macro.c
> @@ -2773,8 +2773,13 @@ static int wsa_macro_probe(struct platform_device *pdev)
>   	wsa->dev = dev;
>   
>   	/* set MCLK and NPL rates */
> -	clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
> -	clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
> +	ret = clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
> +	if (ret)
> +		return ret;
> +
> +	ret = clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
> +	if (ret)
> +		return ret;
>   
>   	ret = devm_pm_clk_create(dev);
>   	if (ret)
> 

Apart from a nitpick in the commit message, code looks good.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ASoC: codecs: lpass-va-macro: check clk_set_rate() return value
  2026-07-15  8:29 ` [PATCH 2/2] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
@ 2026-07-15  9:35   ` Cezary Rojewski
  2026-07-15 10:06   ` Konrad Dybcio
  1 sibling, 0 replies; 8+ messages in thread
From: Cezary Rojewski @ 2026-07-15  9:35 UTC (permalink / raw)
  To: Ajay Kumar Nandam
  Cc: linux-sound, linux-arm-msm, linux-kernel, Srinivas Kandagatla,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai

On 7/15/2026 10:29 AM, Ajay Kumar Nandam wrote:
> clk_set_rate() returns 0 on success or a negative errno on failure but
> the VA macro probe function was ignoring it. Check the return value and
> bail out of probe on failure.
Ditto as with 1/2: _is_ ignoring it. s/was/is/.

A patch is a proposal, there is no "was" until it is merged.
Code itself looks good.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: check clk_set_rate() return value
  2026-07-15  8:29 ` [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: " Ajay Kumar Nandam
  2026-07-15  9:33   ` Cezary Rojewski
@ 2026-07-15 10:06   ` Konrad Dybcio
  1 sibling, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-15 10:06 UTC (permalink / raw)
  To: Ajay Kumar Nandam, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel

On 7/15/26 10:29 AM, Ajay Kumar Nandam wrote:
> clk_set_rate() returns 0 on success or a negative errno on failure but
> the WSA macro probe function was ignoring it. Check the return value and
> bail out of probe on failure.
> 
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> ---

Please resubmit with the commit message amended and carry my:

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] ASoC: codecs: lpass-va-macro: check clk_set_rate() return value
  2026-07-15  8:29 ` [PATCH 2/2] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
  2026-07-15  9:35   ` Cezary Rojewski
@ 2026-07-15 10:06   ` Konrad Dybcio
  1 sibling, 0 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-07-15 10:06 UTC (permalink / raw)
  To: Ajay Kumar Nandam, Srinivas Kandagatla, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai
  Cc: linux-sound, linux-arm-msm, linux-kernel

On 7/15/26 10:29 AM, Ajay Kumar Nandam wrote:
> clk_set_rate() returns 0 on success or a negative errno on failure but
> the VA macro probe function was ignoring it. Check the return value and
> bail out of probe on failure.
> 
> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: check clk_set_rate() return value
  2026-07-15  9:33   ` Cezary Rojewski
@ 2026-07-15 12:21     ` Ajay Kumar Nandam
  0 siblings, 0 replies; 8+ messages in thread
From: Ajay Kumar Nandam @ 2026-07-15 12:21 UTC (permalink / raw)
  To: Cezary Rojewski
  Cc: linux-sound, linux-arm-msm, linux-kernel, Srinivas Kandagatla,
	Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai



On 7/15/2026 3:03 PM, Cezary Rojewski wrote:
> On 7/15/2026 10:29 AM, Ajay Kumar Nandam wrote:
>> clk_set_rate() returns 0 on success or a negative errno on failure but
>> the WSA macro probe function was ignoring it. Check the return value and
> 
> _is_ ignoring it. s/was/is/.
> 
> A patch is a proposal, there is no "was" until it is merged.
> 
>> bail out of probe on failure.
>>
>> Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
>> ---
>>   sound/soc/codecs/lpass-wsa-macro.c | 9 +++++++--
>>   1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/ 
>> lpass-wsa-macro.c
>> index f511816aa4a0..fc9e0a37c042 100644
>> --- a/sound/soc/codecs/lpass-wsa-macro.c
>> +++ b/sound/soc/codecs/lpass-wsa-macro.c
>> @@ -2773,8 +2773,13 @@ static int wsa_macro_probe(struct 
>> platform_device *pdev)
>>       wsa->dev = dev;
>>       /* set MCLK and NPL rates */
>> -    clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
>> -    clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
>> +    ret = clk_set_rate(wsa->mclk, WSA_MACRO_MCLK_FREQ);
>> +    if (ret)
>> +        return ret;
>> +
>> +    ret = clk_set_rate(wsa->npl, WSA_MACRO_MCLK_FREQ);
>> +    if (ret)
>> +        return ret;
>>       ret = devm_pm_clk_create(dev);
>>       if (ret)
>>
> 
> Apart from a nitpick in the commit message, code looks good.

ACK, updated in V2 version


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-15 12:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-15  8:29 [PATCH 0/2] ASoC: codecs: lpass-{wsa,va}-macro: check clk_set_rate() return value Ajay Kumar Nandam
2026-07-15  8:29 ` [PATCH 1/2] ASoC: codecs: lpass-wsa-macro: " Ajay Kumar Nandam
2026-07-15  9:33   ` Cezary Rojewski
2026-07-15 12:21     ` Ajay Kumar Nandam
2026-07-15 10:06   ` Konrad Dybcio
2026-07-15  8:29 ` [PATCH 2/2] ASoC: codecs: lpass-va-macro: " Ajay Kumar Nandam
2026-07-15  9:35   ` Cezary Rojewski
2026-07-15 10:06   ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox