linux-stable/drivers/pci
Rafael J. Wysocki f674adadd7 PCI: Use pci_update_current_state() in pci_enable_device_flags()
[ Upstream commit 14858dcc3b ]

Updating the current_state field of struct pci_dev the way it is done
in pci_enable_device_flags() before calling do_pci_enable_device() may
not work.  For example, if the given PCI device depends on an ACPI
power resource whose _STA method initially returns 0 ("off"), but the
config space of the PCI device is accessible and the power state
retrieved from the PCI_PM_CTRL register is D0, the current_state
field in the struct pci_dev representing that device will get out of
sync with the power.state of its ACPI companion object and that will
lead to power management issues going forward.

To avoid such issues, make pci_enable_device_flags() call
pci_update_current_state() which takes ACPI device power management
into account, if present, to retrieve the current power state of the
device.

Link: https://lore.kernel.org/lkml/20210314000439.3138941-1-luzmaximilian@gmail.com/
Reported-by: Maximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Maximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 11:45:27 +02:00
..
dwc
endpoint
host PCI: aardvark: Fix masking and unmasking legacy INTx interrupts 2021-09-22 11:45:26 +02:00
hotplug ACPI / hotplug / PCI: Fix reference count leak in enable_slot() 2021-05-22 10:57:42 +02:00
pcie
switch
access.c
ats.c
bus.c
ecam.c
host-bridge.c
hotplug-pci.c
htirq.c
iov.c
irq.c
Kconfig
Makefile
mmap.c
msi.c PCI/MSI: Skip masking MSI-X on Xen PV 2021-09-22 11:45:24 +02:00
of.c
pci-acpi.c PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() 2020-12-29 13:47:04 +01:00
pci-driver.c
pci-label.c PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun 2021-07-20 16:17:53 +02:00
pci-mid.c
pci-stub.c
pci-sysfs.c
pci.c PCI: Use pci_update_current_state() in pci_enable_device_flags() 2021-09-22 11:45:27 +02:00
pci.h PCI: thunder: Fix compile testing 2021-05-22 10:57:42 +02:00
probe.c PCI: Release OF node in pci_scan_device()'s error path 2021-05-22 10:57:38 +02:00
proc.c
quirks.c PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported 2021-09-22 11:45:25 +02:00
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c
slot.c PCI: Fix pci_slot_release() NULL pointer dereference 2020-12-29 13:47:11 +01:00
syscall.c PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure 2021-09-22 11:45:25 +02:00
vc.c
vpd.c
xen-pcifront.c