On Mon, Jun 23, 2025 at 08:43:25AM +0200, Lukas Wunner wrote: > On Sun, Jun 22, 2025 at 01:39:26PM -0500, Mario Limonciello wrote: > > > > On 6/21/25 2:05 PM, Lukas Wunner wrote: > > > > > So the refcount decrement happens in pcie_portdrv_probe() and > > > > > the refcount increment happens in pcie_portdrv_remove(). > > > > > Both times it's conditional on pci_bridge_d3_possible(). > > > > > Does that return a different value on probe versus remove? > > > > I did this check and yes specifically on this PCIe port with the underflow > > the d3 possible lookup returns false during pcie_portdrv_remove(). It > > returns true during pcie_portdrv_probe(). > > That's not supposed to happen. The expectation is that > pci_bridge_d3_possible() always returns the same value. I'm wondering if the patch below fixes the issue? Normally the "is_thunderbolt" check in pci_bridge_d3_possible() should return true for this particular device. But there's a check for pciehp_is_native() before that and it accesses config space to check if the Hot-Plug Capable bit is set. The device is inaccessible, so the expectation is that "all ones" is returned, which implies a set HPC bit. But maybe for some reason "all ones" isn't returned anymore? If the patch below does help, could you check what the read of the Slot Capabilities register returns? Thanks! -- >8 -- From: Lukas Wunner <lukas@xxxxxxxxx> Subject: [PATCH] PCI/ACPI: Use cached is_hotplug_bridge value in pciehp_is_native() Signed-off-by: Lukas Wunner <lukas@xxxxxxxxx> --- drivers/pci/pci-acpi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index b78e0e4..909ca4a 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -821,8 +821,7 @@ bool pciehp_is_native(struct pci_dev *bridge) if (!IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE)) return false; - pcie_capability_read_dword(bridge, PCI_EXP_SLTCAP, &slot_cap); - if (!(slot_cap & PCI_EXP_SLTCAP_HPC)) + if (!bridge->is_hotplug_bridge) return false; if (pcie_ports_native) -- 2.47.2