Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH] cpufreq: airoha: fix probe failure with correct error check
@ 2026-08-21  8:45 Christian Marangi
  2026-08-21  9:40 ` Zhongqiu Han
  2026-08-31  5:32 ` Viresh Kumar
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Marangi @ 2026-08-21  8:45 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar, Christian Marangi, linux-pm,
	linux-kernel
  Cc: Daniel Schwierzeck, stable

From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

dev_pm_domain_attach_list() returns the number of attached PM domains
on success (a positive count), or a negative error code on failure.
The driver checks "if (ret)" which treats a successful attachment of
one or more PM domains as an error, causing the probe to fail with
return code 1.

Fix by checking "if (ret < 0)" like all other users of this API.

Cc: stable@vger.kernel.org
Fixes: 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/cpufreq/airoha-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/airoha-cpufreq.c b/drivers/cpufreq/airoha-cpufreq.c
index 3e7770860d13..8283c528d0c1 100644
--- a/drivers/cpufreq/airoha-cpufreq.c
+++ b/drivers/cpufreq/airoha-cpufreq.c
@@ -64,7 +64,7 @@ static int airoha_cpufreq_probe(struct platform_device *pdev)
 	/* Attach PM for OPP */
 	ret = dev_pm_domain_attach_list(cpu_dev, &attach_data,
 					&priv->pd_list);
-	if (ret)
+	if (ret < 0)
 		goto clear_opp_config;
 
 	cpufreq_dt = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
-- 
2.53.0


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

* Re: [PATCH] cpufreq: airoha: fix probe failure with correct error check
  2026-08-21  8:45 [PATCH] cpufreq: airoha: fix probe failure with correct error check Christian Marangi
@ 2026-08-21  9:40 ` Zhongqiu Han
  2026-08-31  5:32 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Zhongqiu Han @ 2026-08-21  9:40 UTC (permalink / raw)
  To: Christian Marangi, Rafael J. Wysocki, Viresh Kumar, linux-pm,
	linux-kernel
  Cc: Daniel Schwierzeck, stable, zhongqiu.han

On 8/21/2026 4:45 PM, Christian Marangi wrote:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> dev_pm_domain_attach_list() returns the number of attached PM domains
> on success (a positive count), or a negative error code on failure.
> The driver checks "if (ret)" which treats a successful attachment of
> one or more PM domains as an error, causing the probe to fail with
> return code 1.
> 
> Fix by checking "if (ret < 0)" like all other users of this API.
> 
> Cc: stable@vger.kernel.org
> Fixes: 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Reviewed-by: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>

> ---
>   drivers/cpufreq/airoha-cpufreq.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/airoha-cpufreq.c b/drivers/cpufreq/airoha-cpufreq.c
> index 3e7770860d13..8283c528d0c1 100644
> --- a/drivers/cpufreq/airoha-cpufreq.c
> +++ b/drivers/cpufreq/airoha-cpufreq.c
> @@ -64,7 +64,7 @@ static int airoha_cpufreq_probe(struct platform_device *pdev)
>   	/* Attach PM for OPP */
>   	ret = dev_pm_domain_attach_list(cpu_dev, &attach_data,
>   					&priv->pd_list);
> -	if (ret)
> +	if (ret < 0)
>   		goto clear_opp_config;
>   
>   	cpufreq_dt = platform_device_register_simple("cpufreq-dt", -1, NULL, 0);


-- 
Thx and BRs,
Zhongqiu Han

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

* Re: [PATCH] cpufreq: airoha: fix probe failure with correct error check
  2026-08-21  8:45 [PATCH] cpufreq: airoha: fix probe failure with correct error check Christian Marangi
  2026-08-21  9:40 ` Zhongqiu Han
@ 2026-08-31  5:32 ` Viresh Kumar
  1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2026-08-31  5:32 UTC (permalink / raw)
  To: Christian Marangi
  Cc: Rafael J. Wysocki, linux-pm, linux-kernel, Daniel Schwierzeck,
	stable

On 21-08-26, 10:45, Christian Marangi wrote:
> From: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> 
> dev_pm_domain_attach_list() returns the number of attached PM domains
> on success (a positive count), or a negative error code on failure.
> The driver checks "if (ret)" which treats a successful attachment of
> one or more PM domains as an error, causing the probe to fail with
> return code 1.
> 
> Fix by checking "if (ret < 0)" like all other users of this API.
> 
> Cc: stable@vger.kernel.org
> Fixes: 84cf9e541ccc ("cpufreq: airoha: Add EN7581 CPUFreq SMCCC driver")
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  drivers/cpufreq/airoha-cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied. Thanks.

-- 
viresh

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

end of thread, other threads:[~2026-08-31  5:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21  8:45 [PATCH] cpufreq: airoha: fix probe failure with correct error check Christian Marangi
2026-08-21  9:40 ` Zhongqiu Han
2026-08-31  5:32 ` Viresh Kumar

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