aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/acpica
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2014-11-11 17:14:11 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2014-11-11 17:14:11 +0000
commit2da2ade0210e75b9a36256cc505d0b9bfc81a975 (patch)
tree0d5fcba643641731e8e5048e07cf36729ab5a791 /sys/dev/acpica
parent1cb8f1cd72c9967f1b276d5ba0f706876cd243ee (diff)
downloadsrc-2da2ade0210e75b9a36256cc505d0b9bfc81a975.tar.gz
src-2da2ade0210e75b9a36256cc505d0b9bfc81a975.zip
Use the correct device (child) when asking the bus layer about which power
state said device should go into. This was a snafu introduced in the ACPI/PCI awareness separation. When putting a device into a power state, the bus (and thus firmware, eg ACPI) should be asked before hand to check whether the device can indeed go into that power state. There's a set of nodes in ACPI under each device - the _SxD nodes - which state which ACPI power state to put the device into when the system is going into power save state 'x'. So when going into S3, the existence of an _S3D node would override whatever the system was trying to do. By default the PCI code wants to put devices into D3 before suspending. I have a laptop here (Asus Zenbook - check the PR) whose EHCI controller really wants to be in D2 during suspend, not D3. So if we put it into D3 and then try to enter S3, everything hangs. The device itself can go into D3 - it just can't be there when the call to ACPI to enter S3 occurs. The PCI patch fixes this. jkim@ noticed that the same is needed for the ACPI child device enumeration. Thankyou to Matt Dillon (the programmer, not the actor) for buying me this particular laptop so I could debug the issues with the Atheros AR9485 that is in it. It's his fault that I ended up with this laptop and was sufficiently annoyed by the lack of USB suspend to go down this rabbit hole. Tested: * Thinkpad T400 * Thinkpad X230 * Thinkpad T42 * Thinkpad T60 * Asus Zenbook (see PR) * Asus EEEPC 701 * Asus EEEPC 1001PX TODO: * Figure out what we should do about devices we unload drivers for that want to be in a specific state when entering S3 / S4 - the "put devices into D3 if they're not bound to a driver" option may also mess with things. PR: kern/194884 Reviewed by: jhb, jkim MFC after: 1 week Relnotes: yes Sponsored by: Matt Dillon <dillon@apollo.backplane.com> (hardware)
Notes
Notes: svn path=/head/; revision=274386
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r--sys/dev/acpica/acpi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index 71fbe3226b6a..e7389af50db7 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -710,7 +710,7 @@ acpi_set_power_children(device_t dev, int state)
child = devlist[i];
dstate = state;
if (device_is_attached(child) &&
- acpi_device_pwr_for_sleep(parent, dev, &dstate) == 0)
+ acpi_device_pwr_for_sleep(parent, child, &dstate) == 0)
acpi_set_powerstate(child, dstate);
}
free(devlist, M_TEMP);