linux/drivers/pci
Lukas Wunner bbf10cd686 PCI: pciehp: Ignore belated Presence Detect Changed caused by DPC
Commit c3be50f754 ("PCI: pciehp: Ignore Presence Detect Changed caused by
DPC") sought to ignore Presence Detect Changed events occurring as a side
effect of Downstream Port Containment.

The commit awaits recovery from DPC and then clears events which occurred
in the meantime.  However if the first event seen after DPC is Data Link
Layer State Changed, only that event is cleared and not Presence Detect
Changed.  The object of the commit is thus defeated.

That's because pciehp_ist() computes the events to clear based on the local
"events" variable instead of "ctrl->pending_events".  The former contains
the events that had occurred when pciehp_ist() was entered, whereas the
latter also contains events that have accumulated while awaiting DPC
recovery.

In practice, the order of PDC and DLLSC events is arbitrary and the delay
in-between can be several milliseconds.

So change the logic to always clear PDC events, even if they come after an
initial DLLSC event.

Fixes: c3be50f754 ("PCI: pciehp: Ignore Presence Detect Changed caused by DPC")
Reported-by: Lương Việt Hoàng <tcm4095@gmail.com>
Reported-by: Joel Mathew Thomas <proxy0@tutamail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219765#c165
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Lương Việt Hoàng <tcm4095@gmail.com>
Tested-by: Joel Mathew Thomas <proxy0@tutamail.com>
Link: https://patch.msgid.link/d9c4286a16253af7e93eaf12e076e3ef3546367a.1750257164.git.lukas@wunner.de
2025-06-18 10:10:19 -05:00
..
controller pci-v6.16-changes 2025-06-04 11:26:17 -07:00
endpoint PCI: endpoint: Align pci_epc_set_msix(), pci_epc_ops::set_msix() nr_irqs encoding 2025-05-28 16:47:56 -05:00
hotplug PCI: pciehp: Ignore belated Presence Detect Changed caused by DPC 2025-06-18 10:10:19 -05:00
msi PCI/MSI: Size device MSI domain with the maximum number of vectors 2025-06-04 11:19:25 +02:00
pcie Merge branch 'pci/ptm-debugfs' 2025-06-04 10:50:44 -05:00
pwrctrl PCI/pwrctrl: Rename pwrctrl Kconfig symbols and slot module 2025-05-23 15:22:42 -05:00
switch
access.c
ats.c
bus.c PCI: Limit visibility of match_driver flag to PCI core 2025-05-15 13:40:52 +00:00
devres.c PCI: Remove redundant set of request functions 2025-05-20 07:39:15 +00:00
doe.c
ecam.c
host-bridge.c
iomap.c PCI: Remove hybrid-devres usage warnings from kernel-doc 2025-05-20 07:39:16 +00:00
iov.c
irq.c
Kconfig PCI: Add CONFIG_MMU dependency 2025-04-23 15:40:30 -05:00
Makefile
mmap.c
npem.c
of_property.c
of.c
p2pdma.c PCI/P2PDMA: Refactor the p2pdma mapping helpers 2025-05-06 08:36:53 +02:00
pci-acpi.c PCI/ACPI: Fix allocated memory release on error in pci_acpi_scan_root() 2025-05-22 11:00:03 +00:00
pci-bridge-emul.c
pci-bridge-emul.h
pci-driver.c Merge branch 'pci/pm' 2025-06-04 10:50:01 -05:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c
pci-sysfs.c Merge branch 'pci/pm' 2025-06-04 10:50:01 -05:00
pci.c PCI/PM: Set up runtime PM even for devices without PCI PM 2025-06-13 14:38:45 -05:00
pci.h pci-v6.16-changes 2025-06-04 11:26:17 -07:00
probe.c PCI: Limit visibility of match_driver flag to PCI core 2025-05-15 13:40:52 +00:00
proc.c
quirks.c pci-v6.16-changes 2025-06-04 11:26:17 -07:00
remove.c
rom.c
search.c
setup-bus.c pci-v6.16-changes 2025-06-04 11:26:17 -07:00
setup-res.c
slot.c
syscall.c
tph.c
vc.c
vgaarb.c
vpd.c
xen-pcifront.c