On Monday 01 November 2004 18:31, Benjamin Herrenschmidt wrote: > On Mon, 2004-11-01 at 18:00 -0700, David Brownell wrote: > > On Monday 01 November 2004 12:26, Pavel Machek wrote: > > > Hi! > > > > > > This adapts few drivers to type-safe pci powermanagment. I introduced > > > device_to_pci_state helper that will be usefull to few drivers... Does > > > it look okay? > > > > I'd rather have something like the attached patch. > > Fixed policy mappings are generically broken; what > > about devices that don't support PCI_D2? > > > > This should I guess use the new "pci_power_t", but > > I'm not that current yet. > > Your snipped (please, inline, don't attach) I use what reliably gets through mailers; no apologies! > would mean D2 is to be > preferred over D3 at all times ? Only for standby and STR. If the driver has particular opinions -- say, it knows that after D3 a firmware reload is needed, AND that it can somehow guarantee D2 is supported (rarely an option for USB HCDs or other class drivers) -- it can apply whatever policy it likes, and won't use that routine in its pci suspend() entry. But otherwise, it can at least guarantee that the controller enters some plausible low power state. S1 uses D1 if possible, else D3hot; S2 uses D2 if possible, else D3hot. Oh, and all those "legacy" controllers without PCI PM support -- they stay in D0 (no choice). Thing is, D3hot is always supported given PCI PM. D2 isn't, unless maybe you're talking about some particular chips instead of generic code. - Dave