diff mbox

ARM: cpuidle: silence error on driver registration failure

Message ID 1529332462-3956-1-git-send-email-sudeep.holla@arm.com (mailing list archive)
State Mainlined
Delegated to: Rafael Wysocki
Headers show

Commit Message

Sudeep Holla June 18, 2018, 2:34 p.m. UTC
It's perfectly fine to have multiple cpuidle driver compiled in the
build configuration. However, it's not good to throw error on driver
registration failure if some other driver is already initialised and
assigned. In such cases, __cpuidle_register_driver returns -EBUSY and
we can check for such error before throwing the error.

Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 drivers/cpuidle/cpuidle-arm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Hi,

I am seeing this error with multi_v7_defconfig but the platform doesn't
use cpuidle-arm driver.

Regards,
Sudeep

--
2.7.4

Comments

Daniel Lezcano June 18, 2018, 4 p.m. UTC | #1
On 18/06/2018 16:34, Sudeep Holla wrote:
> It's perfectly fine to have multiple cpuidle driver compiled in the
> build configuration. However, it's not good to throw error on driver
> registration failure if some other driver is already initialised and
> assigned. In such cases, __cpuidle_register_driver returns -EBUSY and
> we can check for such error before throwing the error.
> 
> Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> ---
>  drivers/cpuidle/cpuidle-arm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
> index e07bc7ace774..073557f433eb 100644
> --- a/drivers/cpuidle/cpuidle-arm.c
> +++ b/drivers/cpuidle/cpuidle-arm.c
> @@ -105,7 +105,8 @@ static int __init arm_idle_init_cpu(int cpu)
> 
>  	ret = cpuidle_register_driver(drv);
>  	if (ret) {
> -		pr_err("Failed to register cpuidle driver\n");
> +		if (ret != -EBUSY)
> +			pr_err("Failed to register cpuidle driver\n");
>  		goto out_kfree_drv;
>  	}
> 
> --
> 2.7.4
>
Rafael J. Wysocki June 29, 2018, 8:57 a.m. UTC | #2
On Monday, June 18, 2018 6:00:25 PM CEST Daniel Lezcano wrote:
> On 18/06/2018 16:34, Sudeep Holla wrote:
> > It's perfectly fine to have multiple cpuidle driver compiled in the
> > build configuration. However, it's not good to throw error on driver
> > registration failure if some other driver is already initialised and
> > assigned. In such cases, __cpuidle_register_driver returns -EBUSY and
> > we can check for such error before throwing the error.
> > 
> > Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
> > Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > ---
> >  drivers/cpuidle/cpuidle-arm.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> 
> > diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
> > index e07bc7ace774..073557f433eb 100644
> > --- a/drivers/cpuidle/cpuidle-arm.c
> > +++ b/drivers/cpuidle/cpuidle-arm.c
> > @@ -105,7 +105,8 @@ static int __init arm_idle_init_cpu(int cpu)
> > 
> >  	ret = cpuidle_register_driver(drv);
> >  	if (ret) {
> > -		pr_err("Failed to register cpuidle driver\n");
> > +		if (ret != -EBUSY)
> > +			pr_err("Failed to register cpuidle driver\n");
> >  		goto out_kfree_drv;
> >  	}
> > 
> > --
> > 2.7.4
> > 

Patch queued up for 4.19, thanks!
diff mbox

Patch

diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
index e07bc7ace774..073557f433eb 100644
--- a/drivers/cpuidle/cpuidle-arm.c
+++ b/drivers/cpuidle/cpuidle-arm.c
@@ -105,7 +105,8 @@  static int __init arm_idle_init_cpu(int cpu)

 	ret = cpuidle_register_driver(drv);
 	if (ret) {
-		pr_err("Failed to register cpuidle driver\n");
+		if (ret != -EBUSY)
+			pr_err("Failed to register cpuidle driver\n");
 		goto out_kfree_drv;
 	}