Re: Nested suspends; messages vs. states

Patrick Mochel
2005-03-24T01:41:35Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1148 bytes --]

On Wed, 23 Mar 2005, Benjamin Herrenschmidt wrote:

> > When a driver is bound to a device, it will modify the static array as
> > necessary (removing dangerous states, and changing the method pointers),
> > and it will fill in the pointer for device/driver specific states.
>
> The driver just exposes it's array that gets attached to struct device.
> No need to "modify" an existing array or whatever. In 99.9% of the
> states, the array will just be a static structure in the driver.

I'm talking about an array of device states the device supports. They
would be exporting them to userspace for the purpose of device power
management. While it's related to the device states a driver supports,
it's not exactly the same thing.

You want to expose only the mutual set of those sets (the states the
device and the driver both support) on a per-device basis. The easiest way
to do that would be with a per-device array. You could do it with a
per-driver array, but in the case where a driver supports different revs
of a chip with different power management capabilities, you'd have to
constantly check what rev of the chip you're using..

Pat