tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pmf(9): shutdown & D1/D2 states



Following some thought and reading, I have a couple revisions to make:

On Sun, Dec 23, 2007 at 03:10:14PM -0600, David Young wrote:
> I would like to get some feedback on changes that I would like to make
> to the power management (PM) framework, pmf(9), to support D1 and D2
> power-saving states and wake-up events, and also to distinguish device
> shutdown from device suspension.
> 
> I have integrated some ideas from Jared McNeill and Joerg Sonnenberger,
> but that does not necessarily mean that they endorse my ideas or my
> interpretation of their ideas.  All dumb ideas are mine. :-)
> 
> * Shutdown
> 
> Shutdown and suspend are not the same state, and we can avoid some work
> at shutdown time if we skip a full suspend on most devices, so I propose
> to let devices supply an optional third PM callback:
> 
>         void
>         pmf_device_register(device_t dev, bool (*shutdown)(device_t dev),
>             bool (*suspend)(device_t dev), bool (*resume)(device_t dev));

I believe that device detach routines are suitable for shutting down,
however, they are very "heavyweight."  Many devices are missing detach
routines, but most devices should have them.

> * D1/D2 States: D1
> 
> According to my understanding of D1 state (Jared McNeill filled me in),
> it is a power-reduced state where the device state is not lost.  A device
> may reduce its capacities in D1 state, but it is still operational.
>
> According to this definition, an 802.11 adapter in D1 state may switch
> to 802.11 power-save mode: it powers-down its transmitter & receiver,
> but it stays associated with a network.  It powers up both xmtr and rcvr
> when there is something to transmit, and it powers up its rcvr at periodic
> awake times.  In this way, it stays connected, but it is a bit sluggish.

As it turns out, that is not right.  According to PCI System Architecture,
a device may not initiate PCI bus cycles in D1 or D2 state.

I think that it is desirable to have the abstract save_power and
sleep_lightly states that I have described.  Neither state necessarily
maps to a PCI Dx state, so they should not be named after Dx states.

Dave

-- 
David Young             OJC Technologies
dyoung%ojctech.com@localhost      Urbana, IL * (217) 278-3933 ext 24



Home | Main Index | Thread Index | Old Index