Hi! > > > The point being, sometimes drivers need to suspend and resume > > > each other ... and for PM, the goal is to keep everything > > > suspended except when it's in active use. I've not seen any > > > reason to redefine suspend() and resume() to apply only to > > > system sleep state transitions. > > > > I agree, but we need to properly pass to the driver the semantic > > information of either doing a functional freezing (rejecting or > > blockingany subsequent request from upstream) or letting it do some kind > > of auto-resume. Annything more complicated will require explicit > > collaboration between the drivers (hooks etc...). > > Don't all the suspend() methods imply FREEZE? No. whatever userland-triggered mecanism may be auto-wakeup, which in my pm_message_t meaning pm_message_t has two fields. event ("major"), and flags. If driver does not know event code, it aborts the request, returning error. Some drivers may need to deal with special cases based on the actual type of suspend operation being done at the system level. This is why there are flags. Event codes are: ON -- no need to do anything except special cases like broken HW. FREEZE -- stop DMA and interrupts, and be prepared to reinit HW from scratch. That probably means stop accepting upstream requests, the actual policy of what to do with them beeing specific to a given driver. It's acceptable for a network driver to just drop packets while a block driver is expected to block the queue so no request is lost. (Use IDE as an example on how to do that). FREEZE requires no power state change, and it's expected for drivers to be able to quickly transition back to operating state. SUSPEND -- like FREEZE, but also put hardware into low-power state. If there's need to distinguish several levels of sleep, additional flag is probably best way to do that. (OTOH it is true that all calls that are going to be added in very short term are either FREEZE or SUSPEND). Pavel -- People were complaining that M$ turns users into beta-testers... ...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!