On Tue, 22 Mar 2005, Pavel Machek wrote: > And do we really want user writing D2 to /sys file? Yes, absolutely. And we want the power/state file to contain "D2" when a PCI device is in that state. > > Even just from first principles the mistake is apparent. pm_message_t is > > (or will be, when the structure is defined in its final form) a _message_, > > not a _state_. It contains (will contain) things other than the power > > state setting, such as the "flags" field. Why would a device want to > > store pm_message_t.flags as part of its current state? > > Because device may enter different hw states for different flags? But once the device is in a particular state, the reason why it entered that state doesn't matter any more. Certainly it shouldn't be _part_ of the state. Consider this: Device states are bus- or device-specific structures, as discussed before. But the PM core can export a set of minimal generic state structures for use by drivers that don't need anything more complicated than On, Frozen, or Suspended. How does that sound? Alan Stern