freebsd-nq/sys/dev
Adrian Chadd 2da2ade021 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)
2014-11-11 17:14:11 +00:00
..
aac Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
aacraid
acpi_support The SYSCTL data pointers can come from userspace and must not be 2014-10-28 12:00:39 +00:00
acpica Use the correct device (child) when asking the bus layer about which power 2014-11-11 17:14:11 +00:00
adb No need to check if devd is running before posting an event. 2014-06-21 00:53:56 +00:00
adlink
advansys Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, 2014-06-10 20:25:45 +00:00
ae Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
age Mechanically convert to if_inc_counter(). 2014-09-18 21:01:41 +00:00
agp Initial attachment of the agp(4) to Haswell IGP. There is no handling 2014-11-11 12:56:30 +00:00
aha Fix a few more drivers that were explicitly destroying the bus_dma 2014-06-11 17:03:14 +00:00
ahb Fix a few more drivers that were explicitly destroying the bus_dma 2014-06-11 17:03:14 +00:00
ahci A dma tag alignment should be 1 (not 0) when a device can dma at any address. 2014-11-06 18:15:16 +00:00
aic
aic7xxx shared_scb_data set, but never used, remove it. 2014-08-08 11:47:04 +00:00
alc Remove ALC_LOCK_ASSERT in alc_stop_queue(). This function is now 2014-10-13 01:06:40 +00:00
ale Fix a long standing bug in MAC statistics register access. One 2014-10-08 01:03:32 +00:00
alpm Move all the power management (SMBus) drivers to their own directory, 2014-09-23 06:31:15 +00:00
altera Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
amdpm Move all the power management (SMBus) drivers to their own directory, 2014-09-23 06:31:15 +00:00
amdsbwd
amdsmb Move amdsmb and nfsmb from dev/pci to their own device directory. 2014-09-23 05:54:18 +00:00
amdtemp Add one more AMD Kaveri APU device ID. 2014-10-13 13:13:42 +00:00
amr Set but not used variables eliminated. 2014-08-08 11:47:09 +00:00
an Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
arcmsr
asmc The SYSCTL data pointers can come from userspace and must not be 2014-10-28 12:00:39 +00:00
asr
ata Add another PCI ID for JMB368 PATA controller. 2014-10-20 13:18:52 +00:00
ath Add a missing file from the last commit. 2014-09-30 05:50:34 +00:00
atkbdc Convert from timeout(9) to callout(9). 2014-09-22 14:27:26 +00:00
auxio
bce - Provide bce_get_counter() to return counters that are not collected, 2014-09-25 07:22:24 +00:00
beri Provide a character device allowing us to access BERI memory regions. 2014-10-22 11:30:03 +00:00
bfe Mechanically convert to if_inc_counter(). 2014-09-18 21:03:13 +00:00
bge - Remove empty wrappers ether_poll_[de]register_drv(). [1] 2014-09-28 14:05:18 +00:00
bktr Replace cvsweb link wihg svnweb URL in bktr(4) release notes. 2014-08-30 18:01:45 +00:00
bm Mechanically convert to if_inc_counter(). 2014-09-18 21:05:59 +00:00
buslogic Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, 2014-06-10 20:25:45 +00:00
bvm
bwi Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
bwn Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
bxe Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
cadence Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
cardbus Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
cas Mechanically convert to if_inc_counter(). 2014-09-18 20:53:02 +00:00
ce Convert most BPF_TAP users to BPF_MTAP. 2014-09-28 19:05:22 +00:00
cesa
cfe Convert remaining {g,s}etenv->kern_{g,s}etenv 2014-10-17 17:34:05 +00:00
cfi Follow up to r225617. In order to maximize the re-usability of kernel code 2014-10-16 18:04:43 +00:00
ciss Add detection for ciss(4) controllers that are set to non-raid JBOD mode. 2014-06-29 18:53:15 +00:00
cm Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
cmx
coretemp
cp Convert most BPF_TAP users to BPF_MTAP. 2014-09-28 19:05:22 +00:00
cpuctl Make cpuctl_do_cpuid() and cpuctl_do_cpuid_count() return void. 2014-06-24 06:52:32 +00:00
cpufreq
cs Mechanically convert to if_inc_counter(). 2014-09-18 21:14:46 +00:00
ct
ctau Don't pass RF_ALLOCATED to bus_alloc_resource(). 2014-10-10 19:12:04 +00:00
cx Don't pass RF_ALLOCATED to bus_alloc_resource(). 2014-10-10 19:12:04 +00:00
cxgb Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
cxgbe cxgbe(4): adjust PMRX and PMTX parameters. 2014-11-10 19:45:28 +00:00
cy
dc Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
dcons
de Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
digi Don't pass RF_ALLOCATED to bus_alloc_resource(). 2014-10-10 19:12:04 +00:00
dpms
dpt Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, 2014-06-10 20:25:45 +00:00
drm Remove always false comparison. 2014-09-03 09:58:59 +00:00
drm2 drm: When reading connector mode tunables, list connectors 2014-11-03 14:35:07 +00:00
dwc Mechanically convert to if_inc_counter(). 2014-09-27 20:43:01 +00:00
e1000 Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
ed Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
eisa
en Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
ep Mechanically convert to if_inc_counter(). 2014-09-18 20:11:28 +00:00
esp target is unsigned, so don't compare it < 0 for range test. 2014-08-07 21:56:32 +00:00
et - Provide igb_get_counter() to return counters that are not collected, 2014-09-24 11:23:55 +00:00
etherswitch Add another revision of the AR8327. 2014-07-26 21:33:17 +00:00
ex Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
exca
fatm Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
fb vt(4): Fix mouse cursor handling in vt_fb/creator_vt/ofwfb 2014-08-27 15:10:28 +00:00
fdc Merge the PC98 fdc(4) driver into the MI driver. While here, replace 2014-09-25 20:40:24 +00:00
fdt Fail to probe on simplebus nodes that lack a "ranges" property. 2014-10-19 18:31:11 +00:00
fe Mechanically convert to if_inc_counter(). 2014-09-18 20:15:53 +00:00
ffec Mechanically convert to if_inc_counter(). 2014-09-18 20:58:04 +00:00
filemon
firewire Do not pass whole descriptor block size as align to fwdma_malloc_multiseg 2014-09-27 16:50:24 +00:00
flash
fxp - Remove empty wrappers ether_poll_[de]register_drv(). [1] 2014-09-28 14:05:18 +00:00
gem Mechanically convert to if_inc_counter(). 2014-09-18 20:21:46 +00:00
glxiic Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
glxsb This is the much-discussed major upgrade to the random(4) device, known to you all as /dev/random. 2014-10-30 21:21:53 +00:00
gpio Fix the build of non-FDT systems by moving the gpiobusvar.h header outside 2014-11-01 10:40:29 +00:00
gxemul Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
hatm Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
hifn Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, 2014-06-10 20:25:45 +00:00
hme Mechanically convert to if_inc_counter(). 2014-09-18 21:07:05 +00:00
hpt27xx Remove compat shims for FreeBSD versions older than 8.0. 2014-08-05 23:32:53 +00:00
hptiop Various fixes to hptiop(4): 2014-08-05 23:35:19 +00:00
hptmv Various fixes to hptmv(4): 2014-08-05 23:58:49 +00:00
hptnr Update hptnr(4) driver to version 1.0.1 supplied by the vendor. 2014-08-23 01:52:43 +00:00
hptrr Various fixes to hptrr(4): 2014-08-05 23:47:26 +00:00
hwpmc Fix up module unload for syscall_module_handler consumers. 2014-11-01 22:36:40 +00:00
hyperv Remove struct arpcom. It is unused by most interface types, that allocate 2014-11-07 15:14:10 +00:00
ic
ichsmb
ichwd
ida A dma tag alignment should be 1 (not 0) when a device can dma at any address. 2014-11-06 18:14:12 +00:00
ie Convert most BPF_TAP users to BPF_MTAP. 2014-09-28 19:05:22 +00:00
ieee488
if_ndis Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
iicbus Add a method to iicbus to request IIC_M_NOSTOP behaviour for multibyte 2014-10-27 07:51:26 +00:00
iir
intpm Move all the power management (SMBus) drivers to their own directory, 2014-09-23 06:31:15 +00:00
io
ipmi
ips
ipw Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
isci In rare cases, a SATA drive can stop responding to commands and trigger a 2014-06-30 01:01:54 +00:00
iscsi s/icl_pdu_new_bhs/icl_pdu_new/; no functional changes, just a little 2014-11-03 11:15:51 +00:00
iscsi_initiator Fix old iSCSI initiator to work with new CAM locking. 2014-09-30 16:17:12 +00:00
ismt Add ismt(4) driver. 2014-05-20 19:55:06 +00:00
isp Use the C99 flexible array construct to denote a variable amount of 2014-10-13 16:23:58 +00:00
ispfw
iwi Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
iwn Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
ixgb Provide ixgb_get_counter(). 2014-09-28 07:40:26 +00:00
ixgbe Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
ixl After r274205 unbreak NOIP kernels. vsi is now also used outside 2014-11-07 11:34:06 +00:00
jme Mechanically convert to if_inc_counter(). 2014-09-24 11:33:43 +00:00
joy
kbd
kbdmux
ksyms
le Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
led
lge Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
lmc - Provide lmc_get_counter() to return counters that are not collected, 2014-09-25 07:00:31 +00:00
malo Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
mbox
mc146818 Use FreeBSD-bit-checking-style 2014-10-10 14:17:42 +00:00
mca
mcd
md For md(4), posix shm(3) and tmpfs(5), free swap space used by paged in 2014-07-28 14:27:05 +00:00
mem
mfi Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
mge Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
mii Add driver for Micrel KSZ9021 Gigabit Ethernet Transceiver (PHY). 2014-10-21 09:14:16 +00:00
mk48txx
mlx Add missing calls to bus_dmamap_unload() when freeing static DMA 2014-06-13 18:20:44 +00:00
mly
mmc fwsectors and fwheads used to be somehwat arbitrary. However, they are 2014-10-16 19:52:12 +00:00
mn
mpr Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
mps Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
mpt Hide a harmless "QUEUE FULL EVENT" message behind bootverbose. 2014-06-20 21:18:35 +00:00
mrsas Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
mse Add locking and mark MPSAFE. 2014-10-11 19:36:59 +00:00
msk Eliminate unnecessary checking for M_EXT on mbufs returned by m_getjcl(). 2014-10-13 06:51:40 +00:00
mvs Initialize variables before resource_int_value(). 2014-09-12 12:04:51 +00:00
mwl Mechanically convert to if_inc_counter(). 2014-09-18 20:18:55 +00:00
mxge Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
my Mechanically convert to if_inc_counter(). 2014-09-18 20:59:59 +00:00
nand Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
ncr Lock ncr(4) and mark it MPSAFE along with various other fixes: 2014-09-25 18:43:52 +00:00
ncv
netfpga10g/nf10bmac Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
netmap in the Linux section, properly define the NMG_LOCK type. 2014-11-11 00:13:28 +00:00
nfe Follow up to r225617. In order to maximize the re-usability of kernel code 2014-10-16 18:04:43 +00:00
nfsmb Move amdsmb and nfsmb from dev/pci to their own device directory. 2014-09-23 05:54:18 +00:00
nge Mechanically convert to if_inc_counter(). 2014-09-18 20:23:34 +00:00
nmdm Fix issue with nmdm and leading zeros in device name. 2014-09-10 05:44:15 +00:00
nsp
ntb
null Add missing privilege check when setting the dump device. Before that change it 2014-11-11 04:48:09 +00:00
nvd
nvme Use bitwise OR instead of logical OR when constructing value for 2014-06-10 21:40:43 +00:00
nvram
nvram2env Convert remaining {g,s}etenv->kern_{g,s}etenv 2014-10-17 17:34:05 +00:00
nxge Don't bother clearing maps for static DMA allocations to NULL. Instead, 2014-06-17 18:10:06 +00:00
oce Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
ofw Avoid panic in ofwbus caused by not released resource list entry 2014-11-07 19:34:10 +00:00
patm Follow up to r225617. In order to maximize the re-usability of kernel code 2014-10-16 18:04:43 +00:00
pbio
pccard Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
pccbb For reasons which are not clear, r254263 broke some PCMCIA and CardBus 2014-08-03 21:56:53 +00:00
pcf
pci Use the correct device (child) when asking the bus layer about which power 2014-11-11 17:14:11 +00:00
pcn Mechanically convert to if_inc_counter(). 2014-09-18 20:24:47 +00:00
pdq Mechanically convert to if_inc_counter(). 2014-09-18 20:44:53 +00:00
powermac_nvram
ppbus Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
ppc
proto Add proto(4): A driver for prototyping and diagnostics. 2014-04-28 17:58:40 +00:00
pst
pty
puc puc(4): add an entry for the Oxford Semiconductor OXPCIe952 1S1P card. 2014-10-23 18:03:27 +00:00
qlxgb Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
qlxgbe Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
qlxge Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
quicc
ral Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
random Update comment. 2014-11-11 14:30:35 +00:00
rc
re It seems multicast filtering of RTL8168F does not work. Workaround 2014-10-21 01:31:24 +00:00
rl Mechanically convert to if_inc_counter(). 2014-09-19 10:33:23 +00:00
rndtest
rp
rt Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
safe make this compile on arm... bus_size_t is not size_t, and it has 2014-10-29 02:23:50 +00:00
sbni Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
scc
scd
sdhci class, subclass and progif were never used, so don't bother setting 2014-10-13 16:23:51 +00:00
sec
sf Fix typo. 2014-09-19 03:55:19 +00:00
sfxge Fixup the setting of the baud rate. 2014-10-02 22:05:48 +00:00
sge Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
si Fix build of si(4) and enable it in LINT on amd64 and i386. 2014-08-20 16:07:17 +00:00
siba Remove some unused variables. 2014-05-16 21:19:17 +00:00
siis Initialize variables before resource_int_value(). 2014-09-12 12:04:51 +00:00
sio Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
sis Mechanically convert to if_inc_counter(). 2014-09-18 20:09:35 +00:00
sk Eliminate unnecessary checking for M_EXT on mbufs returned by m_getjcl(). 2014-10-13 06:51:40 +00:00
smbus
smc Fx a type from r271817; it's IFCOUNTER_* not IFNET_*. 2014-09-18 22:10:49 +00:00
sn Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
snc Mechanically convert to if_inc_counter(). 2014-09-18 20:43:17 +00:00
snp
sound Partially fix indentation issues to improve readability helping cooperation with 2014-11-04 23:10:58 +00:00
speaker
spibus
ste Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
stg
stge Mechanically convert to if_inc_counter(). 2014-09-18 21:16:05 +00:00
streams - Remove socket file operations declaration from sys/file.h. 2014-08-26 14:44:08 +00:00
sym Remove ia64. 2014-07-07 00:27:09 +00:00
syscons Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
tdfx
terasic Correct typo in comment 2014-07-29 14:41:28 +00:00
ti - Mechanically convert to if_inc_counter() the rest of counters. 2014-09-26 10:47:57 +00:00
tl Mechanically convert to if_inc_counter(). 2014-09-18 20:03:45 +00:00
tpm
trm Don't destroy bus_dma maps created by bus_dmamem_alloc(). In some cases, 2014-06-10 20:25:45 +00:00
tsec Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
twa
twe
tws Switch from timeout(9) to callout(9). In addition, do not teardown the 2014-09-22 20:38:01 +00:00
tx Mechanically convert to if_inc_counter(). 2014-09-18 20:06:10 +00:00
txp - Provide txp_get_counter() to return counters that are not collected, 2014-09-24 11:58:23 +00:00
uart Drop __DECONST as well as few fixes of style(9). 2014-10-28 03:42:09 +00:00
ubsec Don't check maps for static DMA allocations against NULL to see if an 2014-06-13 19:34:34 +00:00
usb Add new USB IDs. 2014-11-07 11:04:27 +00:00
utopia
vge Mechanically convert to if_inc_counter(). 2014-09-18 20:30:47 +00:00
viapm Move all the power management (SMBus) drivers to their own directory, 2014-09-23 06:31:15 +00:00
viawd
virtio Enable LRO by default when available on vtnet interfaces 2014-11-09 20:04:12 +00:00
vkbd
vmware/vmxnet3 Provide vmxnet3_get_counter() to return counters that are not collected, 2014-09-25 08:36:11 +00:00
vr Mechanically convert to if_inc_counter(). 2014-09-18 20:17:27 +00:00
vt vt(4): Support syscons' SC_HISTORY_SIZE to configure history size 2014-11-04 23:51:35 +00:00
vte - Provide vte_get_counter() to return counters that are not collected, 2014-09-24 11:31:46 +00:00
vx Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
vxge Fix multiple incorrect SYSCTL arguments in the kernel: 2014-10-21 07:31:21 +00:00
watchdog
wb Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
wbwd
wds
wi - Provide wi_get_counter() to return counters that are not collected, 2014-09-24 12:19:00 +00:00
wl Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
wpi Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
wtap Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
xe Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
xen netback: change xnb naming convention 2014-10-22 17:09:12 +00:00
xl Mechanically convert to if_inc_counter(). 2014-09-18 20:35:22 +00:00