linux-stable/drivers/pci
Rafael J. Wysocki 7482c5cb90 PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup()
The idea behind acpi_pm_set_bridge_wakeup() was to allow bridges to
be reference counted for wakeup enabling, because they may be enabled
to signal wakeup on behalf of their subordinate devices and that
may happen for multiple times in a row, whereas for the other devices
it only makes sense to enable wakeup signaling once.

However, this becomes problematic if the bridge itself is suspended,
because it is treated as a "regular" device in that case and the
reference counting doesn't work.

For instance, suppose that there are two devices below a bridge and
they both can signal wakeup.  Every time one of them is suspended,
wakeup signaling is enabled for the bridge, so when they both have
been suspended, the bridge's wakeup reference counter value is 2.

Say that the bridge is suspended subsequently and acpi_pci_wakeup()
is called for it.  Because the bridge can signal wakeup, that
function will invoke acpi_pm_set_device_wakeup() to configure it
and __acpi_pm_set_device_wakeup() will be called with the last
argument equal to 1.  This causes __acpi_device_wakeup_enable()
invoked by it to omit the reference counting, because the reference
counter of the target device (the bridge) is 2 at that time.

Now say that the bridge resumes and one of the device below it
resumes too, so the bridge's reference counter becomes 0 and
wakeup signaling is disabled for it, but there is still the other
suspended device which may need the bridge to signal wakeup on its
behalf and that is not going to work.

To address this scenario, use wakeup enable reference counting for
all devices, not just for bridges, so drop the last argument from
__acpi_device_wakeup_enable() and __acpi_pm_set_device_wakeup(),
which causes acpi_pm_set_device_wakeup() and
acpi_pm_set_bridge_wakeup() to become identical, so drop the latter
and use the former instead of it everywhere.

Fixes: 1ba51a7c14 ("ACPI / PCI / PM: Rework acpi_pci_propagate_wakeup()")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: 4.14+ <stable@vger.kernel.org> # 4.14+
2020-12-07 13:45:11 +01:00
..
controller PCI: mvebu: Fix duplicate resource requests 2020-11-04 13:55:30 -06:00
endpoint PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
hotplug pci-v5.10-changes 2020-10-22 12:41:00 -07:00
pcie Merge branch 'pci/misc' 2020-10-21 09:58:36 -05:00
switch PCI: switchtec: Add missing __iomem tag to fix sparse warnings 2020-07-31 11:23:45 -05:00
access.c Merge branch 'pci/misc' 2020-08-05 18:24:16 -05:00
ats.c Merge branch 'pci/doc' 2020-08-05 18:24:22 -05:00
bus.c PCI: Add device even if driver attach failed 2020-07-07 17:33:41 -05:00
ecam.c PCI/ACPI: Add Ampere Altra SOC MCFG quirk 2020-09-17 12:27:43 -05:00
host-bridge.c
iov.c PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY 2020-09-21 14:42:11 -06:00
irq.c PCI: Remove unused pci_lost_interrupt() 2020-07-29 14:25:18 -05:00
Kconfig pci-v5.10-changes 2020-10-22 12:41:00 -07:00
Makefile
mmap.c
msi.c PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable 2020-09-16 16:52:37 +02:00
of.c Merge branch 'pci/doc' 2020-08-05 18:24:22 -05:00
p2pdma.c pci-v5.10-changes 2020-10-22 12:41:00 -07:00
pci-acpi.c PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() 2020-12-07 13:45:11 +01:00
pci-bridge-emul.c PCI: pci-bridge-emul: Export API functions 2020-09-07 14:27:53 +01:00
pci-bridge-emul.h
pci-driver.c pci-v5.10-changes 2020-10-22 12:41:00 -07:00
pci-label.c PCI: Replace http:// links with https:// 2020-06-30 13:05:09 -05:00
pci-mid.c
pci-pf-stub.c PCI/IOV: Simplify pci-pf-stub with module_pci_driver() 2020-09-17 12:40:20 -05:00
pci-stub.c
pci-sysfs.c Merge branch 'pci/misc' 2020-10-21 09:58:36 -05:00
pci.c PCI: Always enable ACS even if no ACS Capability 2020-10-30 16:26:51 -05:00
pci.h PCI/PM: Revert "PCI/PM: Apply D2 delay as milliseconds, not microseconds" 2020-09-30 17:01:46 -05:00
probe.c Merge branch 'remotes/lorenzo/pci/dwc' 2020-10-21 09:58:39 -05:00
proc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
quirks.c pci-v5.10-changes 2020-10-22 12:41:00 -07:00
remove.c PCI: Fix pci_host_bridge struct device release/free handling 2020-05-14 16:36:35 -05:00
rom.c
search.c
setup-bus.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
setup-irq.c
setup-res.c PCI: Replace lkml.org, spinics, gmane with lore.kernel.org 2020-06-30 13:05:16 -05:00
slot.c PCI: Fix pci_create_slot() reference count leak 2020-07-10 15:48:22 -05:00
syscall.c
vc.c PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
vpd.c
xen-pcifront.c dma-mapping: split <linux/dma-mapping.h> 2020-10-06 07:07:03 +02:00