mirror-linux/drivers/pci/hotplug
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
..
Kconfig PCI: Fix typos 2025-03-08 15:08:45 -06:00
Makefile PCI: hotplug: Add OCTEON PCI hotplug controller driver 2024-11-13 17:51:39 -06:00
TODO PCI: shpchp: Remove hpc_ops 2024-08-02 11:39:59 -05:00
acpi_pcihp.c
acpiphp.h
acpiphp_ampere_altra.c PCI: acpiphp_ampere_altra: Switch back to struct platform_driver::remove() 2024-10-03 16:45:55 -05:00
acpiphp_core.c
acpiphp_glue.c Revert "PCI: acpiphp: Reassign resources on bridge if necessary" 2023-12-15 14:55:10 -06:00
acpiphp_ibm.c PCI/ACPI: Constify 'struct bin_attribute' 2024-12-10 13:00:50 -06:00
cpci_hotplug.h PCI: cpcihp: Remove unused .get_power() and .set_power() 2025-02-22 08:03:02 +00:00
cpci_hotplug_core.c PCI: cpcihp: Remove unused .get_power() and .set_power() 2025-02-22 08:03:02 +00:00
cpci_hotplug_pci.c
cpcihp_generic.c
cpcihp_zt5550.c
cpcihp_zt5550.h
cpqphp.h
cpqphp_core.c PCI: Fix typos 2024-09-19 14:24:00 -05:00
cpqphp_ctrl.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
cpqphp_nvram.c
cpqphp_nvram.h
cpqphp_pci.c PCI: cpqphp: Simplify PCI_ScanBusForNonBridge() 2024-10-22 10:06:59 -05:00
cpqphp_sysfs.c PCI: cpqphp: Remove unused struct ctrl_dbg.ctrl 2024-10-18 18:31:52 -05:00
ibmphp.h
ibmphp_core.c
ibmphp_ebda.c
ibmphp_hpc.c
ibmphp_pci.c
ibmphp_res.c
octep_hp.c PCI: hotplug: Add OCTEON PCI hotplug controller driver 2024-11-13 17:51:39 -06:00
pci_hotplug_core.c PCI: hotplug: Drop superfluous #include directives 2025-04-17 14:36:29 -05:00
pciehp.h PCI: pciehp: Ignore Presence Detect Changed caused by DPC 2025-04-15 15:59:15 -05:00
pciehp_core.c PCI: pciehp: Ignore Presence Detect Changed caused by DPC 2025-04-15 15:59:15 -05:00
pciehp_ctrl.c PCI/bwctrl: Replace lbms_count with PCI_LINK_LBMS_SEEN flag 2025-05-15 08:38:40 +00:00
pciehp_hpc.c PCI: pciehp: Ignore belated Presence Detect Changed caused by DPC 2025-06-18 10:10:19 -05:00
pciehp_pci.c PCI: pciehp: Detect device replacement during system sleep 2024-05-30 12:17:34 -05:00
pnv_php.c pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv 2024-07-04 23:10:40 +10:00
rpadlpar.h
rpadlpar_core.c
rpadlpar_sysfs.c
rpaphp.h
rpaphp_core.c
rpaphp_pci.c
rpaphp_slot.c
s390_pci_hpc.c s390 updates for 6.16 merge window 2025-05-26 14:36:05 -07:00
shpchp.h PCI: shpchp: Remove 'shpchp_debug' module parameter 2025-02-19 16:54:42 -06:00
shpchp_core.c PCI: shpchp: Remove 'shpchp_debug' module parameter 2025-02-19 16:54:42 -06:00
shpchp_ctrl.c PCI: shpchp: Remove hpc_ops 2024-08-02 11:39:59 -05:00
shpchp_hpc.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
shpchp_pci.c
shpchp_sysfs.c