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 PCI: switchtec: Add Microchip PCI100X device IDs 2025-01-21 10:47:28 -06:00
Kconfig PCI: Add CONFIG_MMU dependency 2025-04-23 15:40:30 -05:00
Makefile
access.c
ats.c iommufd: Extend IOMMU_GET_HW_INFO to report PASID capability 2025-03-28 10:07:23 -03:00
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 PCI/DOE: Expose DOE features via sysfs 2025-03-21 16:36:01 -05:00
ecam.c PCI: ecam: Allow cfg->priv to be pre-populated from the root port device 2025-04-23 12:52:47 +05:30
host-bridge.c
iomap.c PCI: Remove hybrid-devres usage warnings from kernel-doc 2025-05-20 07:39:16 +00:00
iov.c PCI: Fix NULL dereference in SR-IOV VF creation error path 2025-03-21 14:54:16 -05:00
irq.c
mmap.c
npem.c
of.c PCI: of: Add of_pci_get_equalization_presets() API 2025-04-19 19:42:33 +05:30
of_property.c PCI: of: Create device tree PCI host bridge node 2025-02-28 15:13:51 -06:00
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 s390/pci: Introduce pdev->non_mappable_bars and replace VFIO_PCI_MMAP 2025-03-21 14:54:16 -05:00
quirks.c pci-v6.16-changes 2025-06-04 11:26:17 -07:00
remove.c Merge branch 'pci/devtree-create' 2025-03-27 13:14:45 -05:00
rom.c
search.c
setup-bus.c pci-v6.16-changes 2025-06-04 11:26:17 -07:00
setup-res.c PCI: Do not claim to release resource falsely 2025-03-07 11:26:19 -06:00
slot.c PCI: hotplug: Inline pci_hp_{create,remove}_module_link() 2025-03-04 17:00:12 -06:00
syscall.c
tph.c PCI/TPH: Replace the broken MSI-X control word update 2025-04-09 20:47:30 +02:00
vc.c
vgaarb.c
vpd.c
xen-pcifront.c