All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails
@ 2017-05-26 15:37 David Arcari
  2017-05-29  4:32 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: David Arcari @ 2017-05-26 15:37 UTC (permalink / raw)
  To: linux-acpi; +Cc: David Arcari, Viresh Kumar

For a driver that does not set the CPUFREQ_STICKY flag, if all of the
->init() calls fail, cpufreq_register_driver() should return an error.
This will prevent the driver from loading.

Fixes: ce1bcfe94db8 ("cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs")

Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: David Arcari <darcari@redhat.com>
---
 drivers/cpufreq/cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 0e3f649..26b643d 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
 	if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
 	    list_empty(&cpufreq_policy_list)) {
 		/* if all ->init() calls failed, unregister */
+		ret = -ENODEV;
 		pr_debug("%s: No CPU initialized for driver %s\n", __func__,
 			 driver_data->name);
 		goto err_if_unreg;
-- 
1.8.3.1


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

* Re: [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails
  2017-05-26 15:37 [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails David Arcari
@ 2017-05-29  4:32 ` Viresh Kumar
  2017-05-30 12:05   ` David Arcari
  0 siblings, 1 reply; 4+ messages in thread
From: Viresh Kumar @ 2017-05-29  4:32 UTC (permalink / raw)
  To: David Arcari, Rafael J. Wysocki, linux-pm; +Cc: linux-acpi

You sent it to the wrong list and missed Rafael too. MAINTAINERS file should
help getting these details in the future.

On 26-05-17, 11:37, David Arcari wrote:
> For a driver that does not set the CPUFREQ_STICKY flag, if all of the
> ->init() calls fail, cpufreq_register_driver() should return an error.
> This will prevent the driver from loading.
> 
> Fixes: ce1bcfe94db8 ("cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs")
> 
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: David Arcari <darcari@redhat.com>

+
Cc: 4.0+ <stable@vger.kernel.org> # 4.0+

> ---
>  drivers/cpufreq/cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 0e3f649..26b643d 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>  	if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
>  	    list_empty(&cpufreq_policy_list)) {
>  		/* if all ->init() calls failed, unregister */
> +		ret = -ENODEV;
>  		pr_debug("%s: No CPU initialized for driver %s\n", __func__,
>  			 driver_data->name);
>  		goto err_if_unreg;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

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

* Re: [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails
  2017-05-29  4:32 ` Viresh Kumar
@ 2017-05-30 12:05   ` David Arcari
  2017-05-30 21:42     ` Rafael J. Wysocki
  0 siblings, 1 reply; 4+ messages in thread
From: David Arcari @ 2017-05-30 12:05 UTC (permalink / raw)
  To: Viresh Kumar, Rafael J. Wysocki, linux-pm; +Cc: linux-acpi

On 05/29/2017 12:32 AM, Viresh Kumar wrote:
> You sent it to the wrong list and missed Rafael too. MAINTAINERS file should
> help getting these details in the future.

Oops - my bad.

Rafael - is this OK as is or would you prefer I resend this?

Thanks,

-DA

> 
> On 26-05-17, 11:37, David Arcari wrote:
>> For a driver that does not set the CPUFREQ_STICKY flag, if all of the
>> ->init() calls fail, cpufreq_register_driver() should return an error.
>> This will prevent the driver from loading.
>>
>> Fixes: ce1bcfe94db8 ("cpufreq: check cpufreq_policy_list instead of scanning policies for all CPUs")
>>
>> Cc: Viresh Kumar <viresh.kumar@linaro.org>
>> Signed-off-by: David Arcari <darcari@redhat.com>
> 
> +
> Cc: 4.0+ <stable@vger.kernel.org> # 4.0+
> 
>> ---
>>  drivers/cpufreq/cpufreq.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
>> index 0e3f649..26b643d 100644
>> --- a/drivers/cpufreq/cpufreq.c
>> +++ b/drivers/cpufreq/cpufreq.c
>> @@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>>  	if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
>>  	    list_empty(&cpufreq_policy_list)) {
>>  		/* if all ->init() calls failed, unregister */
>> +		ret = -ENODEV;
>>  		pr_debug("%s: No CPU initialized for driver %s\n", __func__,
>>  			 driver_data->name);
>>  		goto err_if_unreg;
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 


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

* Re: [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails
  2017-05-30 12:05   ` David Arcari
@ 2017-05-30 21:42     ` Rafael J. Wysocki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2017-05-30 21:42 UTC (permalink / raw)
  To: David Arcari; +Cc: Viresh Kumar, linux-pm, linux-acpi

On Tuesday, May 30, 2017 08:05:44 AM David Arcari wrote:
> On 05/29/2017 12:32 AM, Viresh Kumar wrote:
> > You sent it to the wrong list and missed Rafael too. MAINTAINERS file should
> > help getting these details in the future.
> 
> Oops - my bad.
> 
> Rafael - is this OK as is or would you prefer I resend this?

No need to resend, thanks!

I've actually queued it up already.

Thanks,
Rafael

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

end of thread, other threads:[~2017-05-30 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-26 15:37 [PATCH] cpufreq: cpufreq_register_driver should return -ENODEV if init fails David Arcari
2017-05-29  4:32 ` Viresh Kumar
2017-05-30 12:05   ` David Arcari
2017-05-30 21:42     ` Rafael J. Wysocki

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.