linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions
@ 2013-11-08  0:03 Shuah Khan
  2013-11-08  0:03 ` [PATCH 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register() Shuah Khan
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Shuah Khan @ 2013-11-08  0:03 UTC (permalink / raw)
  To: gregkh, rjw; +Cc: Shuah Khan, shuahkhan, linux-kernel

Add Legacy PM OPS usage checks to class, bus, and driver register functions.
If Legacy PM OPS usage is found, print warning message to indicate the driver
code needs updating to use Dev PM OPS interfaces. This will help serve as a way
to track drivers that still use Legacy PM OPS and fix them.

This patch set adds Legacy PM OPS usage check and warning to bus_register(),
__class_register(), and driver_register() functions.

Individual patches in this series are not dependent on each other. The only
reason this is a series is for context and facilitating discussion on the
overall change as opposed individual patches.

Shuah Khan (3):
  drivers/bus: Add Legacy PM OPS usage check and warning to
    bus_register()
  drivers/class: Add Legacy PM OPS usage check and warning to
    __class_register()
  driver: Add Legacy PM OPS usage check and warning to driver_register()

 drivers/base/bus.c    | 3 +++
 drivers/base/class.c  | 4 ++++
 drivers/base/driver.c | 4 ++++
 3 files changed, 11 insertions(+)

-- 
1.8.3.2


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

* [PATCH 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register()
  2013-11-08  0:03 [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
@ 2013-11-08  0:03 ` Shuah Khan
  2013-11-08  0:03 ` [PATCH 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register() Shuah Khan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2013-11-08  0:03 UTC (permalink / raw)
  To: gregkh, rjw; +Cc: Shuah Khan, shuahkhan, linux-kernel

Add Legacy PM OPS usage checks to bus_register() function. If Legacy PM OPS
usage is found, print warning message to indicate the driver code needs
updating to use Dev PM OPS interfaces. This will help serve as a way to track
drivers that still use Legacy PM OPS and fix them.

The Legacy PM OPS check looks for suspend(struct device *, pm_message_t) or
resume(struct device *) bus level interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/base/bus.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 4c289ab..9e68453 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -991,6 +991,9 @@ int bus_register(struct bus_type *bus)
 		goto bus_groups_fail;
 
 	pr_debug("bus: '%s': registered\n", bus->name);
+	if (bus->suspend || bus->resume)
+		pr_warn("bus '%s': Please update to use dev pm ops.\n",
+			bus->name);
 	return 0;
 
 bus_groups_fail:
-- 
1.8.3.2


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

* [PATCH 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register()
  2013-11-08  0:03 [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
  2013-11-08  0:03 ` [PATCH 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register() Shuah Khan
@ 2013-11-08  0:03 ` Shuah Khan
  2013-11-08  0:03 ` [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register() Shuah Khan
  2013-11-14 15:43 ` [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
  3 siblings, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2013-11-08  0:03 UTC (permalink / raw)
  To: gregkh, rjw; +Cc: Shuah Khan, shuahkhan, linux-kernel

Add Legacy PM OPS usage checks to __class_register() function. If Legacy PM OPS
usage is found, print warning message to indicate the driver code needs
updating to use Dev PM OPS interfaces. This will help serve as a way to track
drivers that still use Legacy PM OPS and fix them.

The Legacy PM OPS check looks for suspend(struct device *, pm_message_t) or
resume(struct device *) class level interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/base/class.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index 8b7818b..f26a3f2 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -180,6 +180,10 @@ int __class_register(struct class *cls, struct lock_class_key *key)
 
 	pr_debug("device class '%s': registering\n", cls->name);
 
+	if (cls->suspend || cls->resume)
+		pr_warn("device class '%s': Please update to use dev pm ops\n",
+			cls->name);
+
 	cp = kzalloc(sizeof(*cp), GFP_KERNEL);
 	if (!cp)
 		return -ENOMEM;
-- 
1.8.3.2


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

* [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register()
  2013-11-08  0:03 [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
  2013-11-08  0:03 ` [PATCH 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register() Shuah Khan
  2013-11-08  0:03 ` [PATCH 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register() Shuah Khan
@ 2013-11-08  0:03 ` Shuah Khan
  2013-12-24  0:51   ` Rafael J. Wysocki
  2013-11-14 15:43 ` [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
  3 siblings, 1 reply; 10+ messages in thread
From: Shuah Khan @ 2013-11-08  0:03 UTC (permalink / raw)
  To: gregkh, rjw; +Cc: Shuah Khan, shuahkhan, linux-kernel

Add Legacy PM OPS usage checks to driver_register() function. If Legacy PM OPS
usage is found, print warning message to indicate the driver code needs
updating to use Dev PM OPS interfaces. This will help serve as a way to track
drivers that still use Legacy PM OPS and fix them.

The Legacy PM OPS check looks for suspend(struct device *, pm_message_t) or
resume(struct device *) struct device_driver interfaces.

Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
---
 drivers/base/driver.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 9e29943..10ff280 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -157,6 +157,10 @@ int driver_register(struct device_driver *drv)
 		printk(KERN_WARNING "Driver '%s' needs updating - please use "
 			"bus_type methods\n", drv->name);
 
+	if (drv->suspend || drv->resume)
+		pr_warn("Please update driver '%s' to use dev pm ops.\n",
+			drv->name);
+
 	other = driver_find(drv->name, drv->bus);
 	if (other) {
 		printk(KERN_ERR "Error: Driver '%s' is already registered, "
-- 
1.8.3.2


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

* Re: [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions
  2013-11-08  0:03 [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
                   ` (2 preceding siblings ...)
  2013-11-08  0:03 ` [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register() Shuah Khan
@ 2013-11-14 15:43 ` Shuah Khan
  2013-11-14 21:50   ` Rafael J. Wysocki
  2013-11-15  2:09   ` Greg KH
  3 siblings, 2 replies; 10+ messages in thread
From: Shuah Khan @ 2013-11-14 15:43 UTC (permalink / raw)
  To: gregkh, rjw; +Cc: Shuah Khan, shuahkhan, linux-kernel

On 11/07/2013 05:03 PM, Shuah Khan wrote:
> Add Legacy PM OPS usage checks to class, bus, and driver register functions.
> If Legacy PM OPS usage is found, print warning message to indicate the driver
> code needs updating to use Dev PM OPS interfaces. This will help serve as a way
> to track drivers that still use Legacy PM OPS and fix them.
>
> This patch set adds Legacy PM OPS usage check and warning to bus_register(),
> __class_register(), and driver_register() functions.
>
> Individual patches in this series are not dependent on each other. The only
> reason this is a series is for context and facilitating discussion on the
> overall change as opposed individual patches.
>
> Shuah Khan (3):
>    drivers/bus: Add Legacy PM OPS usage check and warning to
>      bus_register()
>    drivers/class: Add Legacy PM OPS usage check and warning to
>      __class_register()
>    driver: Add Legacy PM OPS usage check and warning to driver_register()
>
>   drivers/base/bus.c    | 3 +++
>   drivers/base/class.c  | 4 ++++
>   drivers/base/driver.c | 4 ++++
>   3 files changed, 11 insertions(+)
>

Greg/Rafael,

Any feedback on this series? Haven't gotten to it or don't like it?

-- Shuah

-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

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

* Re: [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions
  2013-11-14 15:43 ` [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
@ 2013-11-14 21:50   ` Rafael J. Wysocki
  2013-12-11  6:53     ` Greg KH
  2013-11-15  2:09   ` Greg KH
  1 sibling, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2013-11-14 21:50 UTC (permalink / raw)
  To: shuah.kh; +Cc: gregkh, shuahkhan, linux-kernel

On Thursday, November 14, 2013 08:43:27 AM Shuah Khan wrote:
> On 11/07/2013 05:03 PM, Shuah Khan wrote:
> > Add Legacy PM OPS usage checks to class, bus, and driver register functions.
> > If Legacy PM OPS usage is found, print warning message to indicate the driver
> > code needs updating to use Dev PM OPS interfaces. This will help serve as a way
> > to track drivers that still use Legacy PM OPS and fix them.
> >
> > This patch set adds Legacy PM OPS usage check and warning to bus_register(),
> > __class_register(), and driver_register() functions.
> >
> > Individual patches in this series are not dependent on each other. The only
> > reason this is a series is for context and facilitating discussion on the
> > overall change as opposed individual patches.
> >
> > Shuah Khan (3):
> >    drivers/bus: Add Legacy PM OPS usage check and warning to
> >      bus_register()
> >    drivers/class: Add Legacy PM OPS usage check and warning to
> >      __class_register()
> >    driver: Add Legacy PM OPS usage check and warning to driver_register()
> >
> >   drivers/base/bus.c    | 3 +++
> >   drivers/base/class.c  | 4 ++++
> >   drivers/base/driver.c | 4 ++++
> >   3 files changed, 11 insertions(+)
> >
> 
> Greg/Rafael,
> 
> Any feedback on this series? Haven't gotten to it or don't like it?

I haven't had the time to review this, sorry.

Thanks,
Rafael


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

* Re: [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions
  2013-11-14 15:43 ` [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
  2013-11-14 21:50   ` Rafael J. Wysocki
@ 2013-11-15  2:09   ` Greg KH
  1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2013-11-15  2:09 UTC (permalink / raw)
  To: Shuah Khan; +Cc: rjw, shuahkhan, linux-kernel

On Thu, Nov 14, 2013 at 08:43:27AM -0700, Shuah Khan wrote:
> On 11/07/2013 05:03 PM, Shuah Khan wrote:
> > Add Legacy PM OPS usage checks to class, bus, and driver register functions.
> > If Legacy PM OPS usage is found, print warning message to indicate the driver
> > code needs updating to use Dev PM OPS interfaces. This will help serve as a way
> > to track drivers that still use Legacy PM OPS and fix them.
> >
> > This patch set adds Legacy PM OPS usage check and warning to bus_register(),
> > __class_register(), and driver_register() functions.
> >
> > Individual patches in this series are not dependent on each other. The only
> > reason this is a series is for context and facilitating discussion on the
> > overall change as opposed individual patches.
> >
> > Shuah Khan (3):
> >    drivers/bus: Add Legacy PM OPS usage check and warning to
> >      bus_register()
> >    drivers/class: Add Legacy PM OPS usage check and warning to
> >      __class_register()
> >    driver: Add Legacy PM OPS usage check and warning to driver_register()
> >
> >   drivers/base/bus.c    | 3 +++
> >   drivers/base/class.c  | 4 ++++
> >   drivers/base/driver.c | 4 ++++
> >   3 files changed, 11 insertions(+)
> >
> 
> Greg/Rafael,
> 
> Any feedback on this series? Haven't gotten to it or don't like it?

It's the middle of the merge window, where I can't apply any new
patches, and I'm traveling in Korea, so nothing is getting done on any
patches anyone has sent me, you aren't alone :)

Wait until 3.13-rc1 is out, then I'll start digging through my patch
queue and reviewing them, your's is in there as well.

thanks,

greg k-h

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

* Re: [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions
  2013-11-14 21:50   ` Rafael J. Wysocki
@ 2013-12-11  6:53     ` Greg KH
  0 siblings, 0 replies; 10+ messages in thread
From: Greg KH @ 2013-12-11  6:53 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: shuah.kh, shuahkhan, linux-kernel

On Thu, Nov 14, 2013 at 10:50:29PM +0100, Rafael J. Wysocki wrote:
> On Thursday, November 14, 2013 08:43:27 AM Shuah Khan wrote:
> > On 11/07/2013 05:03 PM, Shuah Khan wrote:
> > > Add Legacy PM OPS usage checks to class, bus, and driver register functions.
> > > If Legacy PM OPS usage is found, print warning message to indicate the driver
> > > code needs updating to use Dev PM OPS interfaces. This will help serve as a way
> > > to track drivers that still use Legacy PM OPS and fix them.
> > >
> > > This patch set adds Legacy PM OPS usage check and warning to bus_register(),
> > > __class_register(), and driver_register() functions.
> > >
> > > Individual patches in this series are not dependent on each other. The only
> > > reason this is a series is for context and facilitating discussion on the
> > > overall change as opposed individual patches.
> > >
> > > Shuah Khan (3):
> > >    drivers/bus: Add Legacy PM OPS usage check and warning to
> > >      bus_register()
> > >    drivers/class: Add Legacy PM OPS usage check and warning to
> > >      __class_register()
> > >    driver: Add Legacy PM OPS usage check and warning to driver_register()
> > >
> > >   drivers/base/bus.c    | 3 +++
> > >   drivers/base/class.c  | 4 ++++
> > >   drivers/base/driver.c | 4 ++++
> > >   3 files changed, 11 insertions(+)
> > >
> > 
> > Greg/Rafael,
> > 
> > Any feedback on this series? Haven't gotten to it or don't like it?
> 
> I haven't had the time to review this, sorry.

ping?

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

* Re: [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register()
  2013-11-08  0:03 ` [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register() Shuah Khan
@ 2013-12-24  0:51   ` Rafael J. Wysocki
  2014-01-02 22:59     ` Shuah Khan
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael J. Wysocki @ 2013-12-24  0:51 UTC (permalink / raw)
  To: Shuah Khan; +Cc: gregkh, shuahkhan, linux-kernel

On Thursday, November 07, 2013 05:03:50 PM Shuah Khan wrote:
> Add Legacy PM OPS usage checks to driver_register() function. If Legacy PM OPS
> usage is found, print warning message to indicate the driver code needs
> updating to use Dev PM OPS interfaces. This will help serve as a way to track
> drivers that still use Legacy PM OPS and fix them.
> 
> The Legacy PM OPS check looks for suspend(struct device *, pm_message_t) or
> resume(struct device *) struct device_driver interfaces.
> 
> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
> ---
>  drivers/base/driver.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/base/driver.c b/drivers/base/driver.c
> index 9e29943..10ff280 100644
> --- a/drivers/base/driver.c
> +++ b/drivers/base/driver.c
> @@ -157,6 +157,10 @@ int driver_register(struct device_driver *drv)
>  		printk(KERN_WARNING "Driver '%s' needs updating - please use "
>  			"bus_type methods\n", drv->name);
>  
> +	if (drv->suspend || drv->resume)
> +		pr_warn("Please update driver '%s' to use dev pm ops.\n",
> +			drv->name);

What about the following message instead:

		pr_warn("Driver '%s' needs updating - please use the pm pointer.\n",
			drv->name);

And analogously for bus types and classes?

> +
>  	other = driver_find(drv->name, drv->bus);
>  	if (other) {
>  		printk(KERN_ERR "Error: Driver '%s' is already registered, "
> 

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

* Re: [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register()
  2013-12-24  0:51   ` Rafael J. Wysocki
@ 2014-01-02 22:59     ` Shuah Khan
  0 siblings, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2014-01-02 22:59 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: gregkh, shuahkhan, linux-kernel, shuah Khan

On 12/23/2013 05:51 PM, Rafael J. Wysocki wrote:
> On Thursday, November 07, 2013 05:03:50 PM Shuah Khan wrote:
>> Add Legacy PM OPS usage checks to driver_register() function. If Legacy PM OPS
>> usage is found, print warning message to indicate the driver code needs
>> updating to use Dev PM OPS interfaces. This will help serve as a way to track
>> drivers that still use Legacy PM OPS and fix them.
>>
>> The Legacy PM OPS check looks for suspend(struct device *, pm_message_t) or
>> resume(struct device *) struct device_driver interfaces.
>>
>> Signed-off-by: Shuah Khan <shuah.kh@samsung.com>
>> ---
>>   drivers/base/driver.c | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/base/driver.c b/drivers/base/driver.c
>> index 9e29943..10ff280 100644
>> --- a/drivers/base/driver.c
>> +++ b/drivers/base/driver.c
>> @@ -157,6 +157,10 @@ int driver_register(struct device_driver *drv)
>>   		printk(KERN_WARNING "Driver '%s' needs updating - please use "
>>   			"bus_type methods\n", drv->name);
>>
>> +	if (drv->suspend || drv->resume)
>> +		pr_warn("Please update driver '%s' to use dev pm ops.\n",
>> +			drv->name);
>
> What about the following message instead:
>
> 		pr_warn("Driver '%s' needs updating - please use the pm pointer.\n",
> 			drv->name);

I thought pm ops would be more informative for driver developers. That 
said, I will change the message and re-send the patch.

>
> And analogously for bus types and classes?
>
>> +
>>   	other = driver_find(drv->name, drv->bus);
>>   	if (other) {
>>   		printk(KERN_ERR "Error: Driver '%s' is already registered, "
>>
>
> Thanks!
>


-- 
Shuah Khan
Senior Linux Kernel Developer - Open Source Group
Samsung Research America(Silicon Valley)
shuah.kh@samsung.com | (970) 672-0658

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

end of thread, other threads:[~2014-01-02 22:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-08  0:03 [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
2013-11-08  0:03 ` [PATCH 1/3] drivers/bus: Add Legacy PM OPS usage check and warning to bus_register() Shuah Khan
2013-11-08  0:03 ` [PATCH 2/3] drivers/class: Add Legacy PM OPS usage check and warning to __class_register() Shuah Khan
2013-11-08  0:03 ` [PATCH 3/3] driver: Add Legacy PM OPS usage check and warning to driver_register() Shuah Khan
2013-12-24  0:51   ` Rafael J. Wysocki
2014-01-02 22:59     ` Shuah Khan
2013-11-14 15:43 ` [PATCH 0/3] Add Legacy PM OPS usage checks to class, bus, and driver register functions Shuah Khan
2013-11-14 21:50   ` Rafael J. Wysocki
2013-12-11  6:53     ` Greg KH
2013-11-15  2:09   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).