Re: [RFC] A New Power Management API

Adam Belay
2005-04-17T20:25:17Z

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

On Sat, 2005-04-16 at 10:27 -0700, David Brownell wrote:
> On Thursday 14 April 2005 7:46 pm, Adam Belay wrote:
>
> > The new API uses a power container/domain model.
>
> I like that as a basic organizing principle, and I don't think
> anyone has problems with the notion that the power relationships
> can't always map directly to the physical device tree.
>
> Could you describe a bit about how the containers behave? For
> example, when a device drops its power consumption, how does it
> notify its container? And when sets of devices -- e.g. all USB
> devices, all PCI devices -- support the same power states, how
> will that code be shared? Would "struct power_device" be the
> driver model replacement for "struct power"?

Here are my current thoughts:

When greatest common denominator of power requirements is lowered (as a
result of a power_device lowering its state), the policy manager of the
container "struct power_device" will be notified. Code for the same
states will not be shared, because the method of transitioning these
states is different. Also their meanings are often different. However,
if the states are the same, the mappings will likely be simplistic.

Every "struct device' will have a "struct power_device", but not every
"struct power_device" must have a "struct device". "struct
power_device" will be the base unit of power management topologies.

>
> Also, I'd rather see "struct system_power_state *" everywhere
> you're now passing "int system_state" in the API.
>
> - Dave

Fixed. Thanks for the suggestion.

Adam