On Sunday, 10 June 2007 16:32, Alan Stern wrote: > On Sat, 9 Jun 2007, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki <rjw@xxxxxxx> > > > > The saved_state member of struct dev_pm_info, defined in include/linux/pm.h, is > > not used anywhere, so it can be removed. > > Along the same lines, feature_removal_schedule.txt says that > dev->power.power_state will be removed next month. In preparation, > you could consider removing the prev_state member now. As far as I > know, it isn't used for anything other than avoiding resume method > calls to devices that were already suspended when a system sleep > began. Yes, I considered that too, but I decided to leave if for now in case something depended on it. I'll take another look. ;-) > I suggest that suspend and resume always be called for every device > during a system sleep transition, regardless of the device's state. That's reasonable, I think. > That will have to done anyway once dev->power.power_state is gone. Besides, that would fix the issue with the current code that if dev->class->suspend() changes dev->power.power_state.event to 'off', then dev->bus->suspend() is not called, but dev->bus->resume() will be called during the subsequent resume. > The idea is that drivers should regard these method calls as > notifications that the system is about to go to sleep or has just woken > up, rather than as directives to put their device into a particular > state. > > Thus, if a driver knows that its device was already in a low-power > state before the system sleep then it need not respond to a resume > method call by switching the device to a high-power state. Instead the > driver should be free to take whatever action it thinks is appropriate. > This is already explained in Documentation/power/devices.txt. OK I'll prepare a patch to remove the dev->power.power_state.event checks from the suspend core code. Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth _______________________________________________ linux-pm mailing list linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/linux-pm