On Fri, Apr 27, 2007 at 03:25:46PM +0300, Pekka J Enberg wrote: > From: Nigel Cunningham <nigel@xxxxxxxxxxxxxxxxxx> > > Add power management related debugging into driver core. Make the > kernel complain if a device driver lacks bus and class support for > resume or if a PCI or USB driver does not have a driver specific > resume function. > > Cc: Pavel Machek <pavel@xxxxxx> > Cc: Rafael J. Wysocki <rjw@xxxxxxx> > Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx> > --- > drivers/base/core.c | 13 +++++++++++++ > drivers/pci/pci-driver.c | 6 ++++++ > drivers/usb/core/driver.c | 6 ++++++ > include/linux/device.h | 1 + > 4 files changed, 26 insertions(+) > > Index: 2.6/drivers/base/core.c > =================================================================== > --- 2.6.orig/drivers/base/core.c 2007-04-27 14:42:13.000000000 +0300 > +++ 2.6/drivers/base/core.c 2007-04-27 14:43:14.000000000 +0300 > @@ -652,6 +652,18 @@ int device_add(struct device *dev) > class_intf->add_dev(dev, class_intf); > up(&dev->class->sem); > } > + > +#ifdef CONFIG_PM > + if (!((dev->class && dev->class->resume) || > + (dev->bus && (dev->bus->resume || dev->bus->resume_early))) && > + !dev->pm_safe) { > + printk(KERN_WARNING "Device driver %s lacks bus and class " > + "support for being resumed.\n", > + kobject_name(&dev->kobj)); > + dump_stack(); > + } > +#endif I think you are reporting the wrong thing here, we want to know about the busses and classes without suspend support, not the individual devices, right? And dumping stuff like this to the log for every bus/class isn't the nicest :( > + > Done: > kfree(class_name); > put_device(dev); > @@ -989,6 +1001,7 @@ struct device *device_create(struct clas > dev->class = class; > dev->parent = parent; > dev->release = device_create_release; > + dev->pm_safe = 1; I don't understand the use of this flag, it looks like it is only being set, which doesn't really make it very useful. So NAK on this patch. Oh, and please CC: me on driver core and USB and PCI core changes please... thanks, greg k-h _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm