]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
PCI: pciehp: Use is_pciehp instead of is_hotplug_bridge
authorLukas Wunner <lukas@wunner.de>
Sun, 13 Jul 2025 14:31:03 +0000 (16:31 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 29 Jul 2025 16:45:39 +0000 (11:45 -0500)
The PCIe hotplug driver calculates the depth of a nested hotplug port by
looking at the is_hotplug_bridge flag.  The depth is used as lockdep class
to tell hotplug ports apart.

The is_hotplug_bridge flag encompasses ACPI slots handled by the ACPI
hotplug driver, hence the calculated depth may be too high.  Avoid by
checking the is_pciehp flag instead.

This glitch likely has no user-visible impact:  ACPI slots typically only
exist at the Root Port level, not in nested hotplug hierarchies.  Also,
CONFIG_LOCKDEP is usually only used by developers.  So this is just for
the sake of correctness.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/59a097376a2bb493da9efd66fb196ae4b66f8a09.1752390102.git.lukas@wunner.de
drivers/pci/hotplug/pciehp_hpc.c

index ebd342bda235d4988d8516d040df2d9e60a4ea2e..d783da1dbd24be4adb12134ef611bffec03b23a6 100644 (file)
@@ -995,7 +995,7 @@ static inline int pcie_hotplug_depth(struct pci_dev *dev)
 
        while (bus->parent) {
                bus = bus->parent;
-               if (bus->self && bus->self->is_hotplug_bridge)
+               if (bus->self && bus->self->is_pciehp)
                        depth++;
        }