diff mbox series

PM / devfreq: Fix kernel warning with cpufreq passive register fail

Message ID 20220619222939.32029-1-ansuelsmth@gmail.com
State Accepted
Commit 82c66d2bbbeda9e493487e7413769087a0b46250
Headers show
Series PM / devfreq: Fix kernel warning with cpufreq passive register fail | expand

Commit Message

Christian Marangi June 19, 2022, 10:29 p.m. UTC
Remove cpufreq_passive_unregister_notifier from
cpufreq_passive_register_notifier in case of error as devfreq core
already call unregister on GOV_START fail.

This fix the kernel always printing a WARN on governor PROBE_DEFER as
cpufreq_passive_unregister_notifier is called two times and return
error on the second call as the cpufreq is already unregistered.

Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
 drivers/devfreq/governor_passive.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Chanwoo Choi June 29, 2022, 9:33 p.m. UTC | #1
On 22. 6. 20. 07:29, Christian Marangi wrote:
> Remove cpufreq_passive_unregister_notifier from
> cpufreq_passive_register_notifier in case of error as devfreq core
> already call unregister on GOV_START fail.
> 
> This fix the kernel always printing a WARN on governor PROBE_DEFER as
> cpufreq_passive_unregister_notifier is called two times and return
> error on the second call as the cpufreq is already unregistered.
> 
> Fixes: a03dacb0316f ("PM / devfreq: Add cpu based scaling support to passive governor")
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
> ---
>  drivers/devfreq/governor_passive.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c
> index 72c67979ebe1..8055801cf182 100644
> --- a/drivers/devfreq/governor_passive.c
> +++ b/drivers/devfreq/governor_passive.c
> @@ -336,7 +336,6 @@ static int cpufreq_passive_register_notifier(struct devfreq *devfreq)
>  err_put_policy:
>  	cpufreq_cpu_put(policy);
>  err:
> -	WARN_ON(cpufreq_passive_unregister_notifier(devfreq));
>  
>  	return ret;
>  }

Applied. Thanks.
diff mbox series

Patch

diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c
index 72c67979ebe1..8055801cf182 100644
--- a/drivers/devfreq/governor_passive.c
+++ b/drivers/devfreq/governor_passive.c
@@ -336,7 +336,6 @@  static int cpufreq_passive_register_notifier(struct devfreq *devfreq)
 err_put_policy:
 	cpufreq_cpu_put(policy);
 err:
-	WARN_ON(cpufreq_passive_unregister_notifier(devfreq));
 
 	return ret;
 }