Actually, I had a (separate) bone to pick with all of those answers.
When your whole system moves to an S-state like S3, the power manager asks
all the devices to move to the appropriate D-state by sending an S-IRP
through the stack. The power policy manager in each stack looks at the
negotiated power capabilities struct and moves to the appropriate D-state.
In most cases, the appropriate D-state is as close to “off” as it can be.
So the choice is almost always D3(hot). Whether the device can be placed in
some higher-powered D-state during the system sleep depends on the bus
capabilities and the motherboard. In some cases, motherboards can provide
Vaux during S3, for instance, to allow devices to wake. The motherboard
BIOS reports this through ACPI and this is reflected in the power
capabilities struct.
If the motherboard supports Vaux in the requested S-state and if the device
is armed for wake and if the device requires Vaux to wake, then the power
policy owner may choose to put the device in, for instance, D2. This would
be a common thing when a USB device is armed for wake, since the architects
of the Windows USB stack decided that D2 meant “armed for wake” in USB.
If the device is armed for wake and Vaux is not available, then the power
policy owner can reject the requested S-state, hoping for a higher-powered
S-state that does supply Vaux, like S1.
Note that the definitions of S1, S2 and S3 are pretty loose. They can be
very different between motherboards. ACPI BIOSes describe the aspects of
each and this informs the behavior of the ACPI driver. It’s not true that
“only memory is preserved in S3,” though that may be a common implementation
on a laptop.
In general, S1 powers the processor (which will be halted) and memory any
Vaux. S2 is almost never implemented, but when it is, it’s S3 plus Vaux for
some key devices. S3 turns off the processor completely and leaves memory
intact, in self-refresh. Vaux in S3 may or may not be available. S4
removes power to memory, and the OS is responsible for preserving it by
writing it out to disk. In S4, Vaux may still be available, and commonly is
on wall-powered machines.
D3(hot) becomes D3(cold) if Vcc and Vaux are both lost. In general, if you
are writing a bus driver, you need to know that you map D3(hot) to D3 and
D3(cold) to “not present on the bus, as I can’t verify that I can enumerate
the device.”
Jake Oshins
Hyper-V I/O Architect (former power management and ACPI guy)
Windows Kernel Group
This post implies no warranties and confers no rights.
wrote in message news:xxxxx@ntdev…
Exactly as described by Pavel, Mr. Shatskih, and Mr. Roumenov.
One of the main jobs of the device’s power policy owner is to decide the
D-state the device will be in, given a particular S-state. This is entirely
up the the power policy owner. So, S3 = D3 is definitely not automatic
(though it is common).
Peter
OSR