On Mon, 29 Nov 2004, Pavel Machek wrote: > > This must be resolved. As things stand the USB subsystem has only a > > single suspend() callback for device drivers, with no way to distinguish > > between selective and system suspend. > > USB should really pass down suspend_message_t parameter it got from > higher levels. I'm not sure I agree with that. Perhaps the driver could use the extra information... but the fact is that USB only defines a single "suspended" state, and when a device is suspended the only feature you can enable or disable is whether it sends resume/wakeup requests. > > Should SELECTIVE_SUSPEND be added as a PM message type? Then calls > > That's one possibility. Or we might just have a flag for that. It seems like a waste to force drivers to store information in every device structure about whether the current suspend is selective or system-wide. Particularly since system-wide suspends always affect every device when they occur. Why not instead have a globally-available flag or API for checking whether selective resume requests should be honored? At the start of a system-suspend this flag could be set to disallow resumes, and the flag can be cleared when the system-resume begins. Alan Stern