linux-stable/drivers/pci
Mika Westerberg 53b22f900c PCI / ACPI: Add _PR0 dependent devices
If otherwise unrelated PCI devices share ACPI power resources turning
them on causes the devices to enter D0uninitialized power state which may
cause problems.

For example in Intel Ice Lake two root ports (RP0 and RP1), Thunderbolt
controller (NHI) and xHCI controller all share power resources as can be
ween in the topology below where power resources are marked with []:

  Host bridge
    |
    +- RP0 ---\
    +- RP1 ---|--+--> [TBT]
    +- NHI --/   |
    |            |
    |            v
    +- xHCI --> [D3C]

In a situation where all devices sharing the power resources are in
D3cold (the power resources are turned off) and for example the
Thunderbolt controller is runtime resumed resulting that the power
resources are turned on. This means that the other devices sharing them
(RP0, RP1 and xHCI) are transitioned into D0uninitialized state. If they
were configured to trigger wake (PME) on a certain event that
configuration gets lost after reset so we would need to re-initialize
them to get the wakeup working as expected again. To do so we would need
to runtime resume all of them to make sure their registers get restored
properly before we can runtime suspend them again.

Since we just added concept of "_PR0 dependent device" we can solve this
by calling the relevant add/remove functions when the PCI device is bind
to its ACPI representation. If it has power resources the PCI device
will be added as dependent device to them and runtime resumed whenever
they are physically turned on. This should make sure PCI core can
reconfigure wakes after the device is transitioned into D0uninitialized.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2019-06-27 12:31:57 +02:00
..
controller pci-v5.2-changes 2019-05-14 10:30:10 -07:00
endpoint Merge branch 'remotes/lorenzo/pci/misc' 2019-05-13 18:34:44 -05:00
hotplug pci-v5.2-changes 2019-05-14 10:30:10 -07:00
pcie PCI: Add missing link delays required by the PCIe spec 2019-06-18 01:40:41 +02:00
switch pci-v5.2-changes 2019-05-14 10:30:10 -07:00
access.c PCI: Uninline PCI bus accessors for better ftracing 2018-10-04 16:37:37 -05:00
ats.c PCI/ATS: Add pci_ats_page_aligned() interface 2019-02-26 11:08:07 +01:00
bus.c PCI: Replace dev_printk(KERN_DEBUG) with dev_info(), etc 2019-05-09 07:49:58 -05:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Add flag so platforms can skip VF scanning 2019-01-01 19:04:37 -06:00
irq.c
Kconfig PCI: Fix PCI kconfig menu organization 2019-01-14 17:01:20 -06:00
Makefile PCI: OF: Allow of_pci_get_max_link_speed() to be used by PCI Endpoint drivers 2019-04-15 13:24:02 +01:00
mmap.c
msi.c PCI: Add pci_dev_id() helper 2019-04-29 16:12:05 -05:00
of.c Merge branch 'remotes/lorenzo/pci/keystone' 2019-05-13 18:34:41 -05:00
p2pdma.c mm/devm_memremap_pages: fix final page put race 2019-06-13 17:34:56 -10:00
pci-acpi.c PCI / ACPI: Add _PR0 dependent devices 2019-06-27 12:31:57 +02:00
pci-bridge-emul.c PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags 2019-02-22 10:51:14 +00:00
pci-bridge-emul.h PCI: pci-bridge-emul: Extend pci_bridge_emul_init() with flags 2019-02-22 10:51:14 +00:00
pci-driver.c Merge back PCI power management material for v5.3. 2019-06-24 10:11:27 +02:00
pci-label.c
pci-mid.c x86/cpu: Sanitize FAM6_ATOM naming 2018-10-02 10:14:32 +02:00
pci-pf-stub.c
pci-stub.c PCI: Replace printk(KERN_INFO) with pr_info(), etc 2019-05-09 07:49:54 -05:00
pci-sysfs.c PCI: Use dev_printk() when possible 2019-05-09 07:49:49 -05:00
pci.c PCI: Do not poll for PME if the device is in D3cold 2019-06-18 01:40:41 +02:00
pci.h PCI: Add missing link delays required by the PCIe spec 2019-06-18 01:40:41 +02:00
probe.c pci-v5.2-changes 2019-05-14 10:30:10 -07:00
proc.c PCI: Mark expected switch fall-throughs 2019-03-20 15:11:11 -05:00
quirks.c pci-v5.2-changes 2019-05-14 10:30:10 -07:00
remove.c PCI/ASPM: Fix link_state teardown on device removal 2018-09-17 16:32:23 -05:00
rom.c
search.c PCI: Add pci_dev_id() helper 2019-04-29 16:12:05 -05:00
setup-bus.c Merge branch 'pci/trivial' 2019-05-13 18:34:48 -05:00
setup-irq.c
setup-res.c
slot.c PCI: Replace printk(KERN_INFO) with pr_info(), etc 2019-05-09 07:49:54 -05:00
syscall.c
vc.c
vpd.c PCI/VPD: Check for VPD access completion before checking for timeout 2018-08-14 16:04:46 -05:00
xen-pcifront.c Merge branch 'pci/printk' 2019-05-13 18:34:46 -05:00