kernel_optimize_test/drivers/pci
Rafael J. Wysocki cc12ab5951 PCI: Use pci_update_current_state() in pci_enable_device_flags()
[ Upstream commit 14858dcc3b3587f4bb5c48e130ee7d68fc2b0a29 ]

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-18 13:40:17 +02:00
..
controller PCI: aardvark: Fix masking and unmasking legacy INTx interrupts 2021-09-18 13:40:10 +02:00
endpoint PCI: endpoint: Fix missing destroy_workqueue() 2021-05-19 10:13:02 +02:00
hotplug PCI: pciehp: Ignore Link Down/Up caused by DPC 2021-07-20 16:05:47 +02:00
pcie PCI/portdrv: Enable Bandwidth Notification only if port supports it 2021-09-18 13:40:10 +02:00
switch
access.c
ats.c
bus.c
ecam.c
host-bridge.c
iov.c
irq.c
Kconfig
Makefile
mmap.c
msi.c PCI/MSI: Skip masking MSI-X on Xen PV 2021-09-18 13:40:06 +02:00
of.c
p2pdma.c PCI/P2PDMA: Avoid pci_get_slot(), which may sleep 2021-07-20 16:05:47 +02:00
pci-acpi.c PM: ACPI: PCI: Drop acpi_pm_set_bridge_wakeup() 2020-12-30 11:54:05 +01:00
pci-bridge-emul.c PCI: pci-bridge-emul: Fix array overruns, improve safety 2021-03-04 11:38:15 +01:00
pci-bridge-emul.h
pci-driver.c
pci-label.c PCI/sysfs: Fix dsm_label_utf16s_to_utf8s() buffer overrun 2021-07-20 16:05:50 +02:00
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c
pci.c PCI: Use pci_update_current_state() in pci_enable_device_flags() 2021-09-18 13:40:17 +02:00
pci.h PCI: pciehp: Ignore Link Down/Up caused by DPC 2021-07-20 16:05:47 +02:00
probe.c PCI: Release OF node in pci_scan_device()'s error path 2021-05-19 10:13:01 +02:00
proc.c
quirks.c PCI: Restrict ASMedia ASM1062 SATA Max Payload Size Supported 2021-09-18 13:40:10 +02:00
remove.c
rom.c
search.c
setup-bus.c
setup-irq.c
setup-res.c PCI: Decline to resize resources if boot config must be preserved 2021-03-04 11:37:18 +01:00
slot.c PCI: Fix pci_slot_release() NULL pointer dereference 2020-12-30 11:54:28 +01:00
syscall.c PCI: Return ~0 data on pciconfig_read() CAP_SYS_ADMIN failure 2021-09-18 13:40:10 +02:00
vc.c
vpd.c PCI: Allow VPD access for QLogic ISP2722 2021-05-14 09:49:57 +02:00
xen-pcifront.c