]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
thunderbolt: Use is_pciehp instead of is_hotplug_bridge
authorLukas Wunner <lukas@wunner.de>
Tue, 12 Aug 2025 13:42:29 +0000 (15:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:37:00 +0000 (15:37 -0500)
[ Upstream commit 5d03847175e81e86d4865456c15638faaf7c0634 ]

The thunderbolt driver sets up device link dependencies from hotplug ports
to the Host Router (aka Native Host Interface, NHI).  When resuming from
system sleep, this allows the Host Router to re-establish tunnels to
attached Thunderbolt devices before the hotplug ports resume.

To identify the hotplug ports, the driver utilizes the is_hotplug_bridge
flag which also encompasses ACPI slots handled by the ACPI hotplug driver.

Thunderbolt hotplug ports are always Hot-Plug Capable PCIe ports, so it is
more apt to identify them with the is_pciehp flag.

Similarly, hotplug ports on older Thunderbolt controllers have broken MSI
support and are quirked to use legacy INTx interrupts instead.  The quirk
identifies them with is_hotplug_bridge, even though all affected ports are
also matched by is_pciehp.  So use is_pciehp here as well.

Signed-off-by: Lukas Wunner <lukas@wunner.de>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/quirks.c
drivers/thunderbolt/tb.c

index 6eb3d20386e957ad26d5ce0b2c8ea808553cde17..214ed060ca1b3da6b15b70e63bedfc48eec426c0 100644 (file)
@@ -3830,7 +3830,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, 0xcf80, quirk_no_pm_reset);
  */
 static void quirk_thunderbolt_hotplug_msi(struct pci_dev *pdev)
 {
-       if (pdev->is_hotplug_bridge &&
+       if (pdev->is_pciehp &&
            (pdev->device != PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C ||
             pdev->revision <= 1))
                pdev->no_msi = 1;
index c14ab1fbeeafd689e28c0f2c04fa195f194cdf86..83a33fc1486abfbf9ed296457b099131c71b7500 100644 (file)
@@ -3336,7 +3336,7 @@ static bool tb_apple_add_links(struct tb_nhi *nhi)
                if (!pci_is_pcie(pdev))
                        continue;
                if (pci_pcie_type(pdev) != PCI_EXP_TYPE_DOWNSTREAM ||
-                   !pdev->is_hotplug_bridge)
+                   !pdev->is_pciehp)
                        continue;
 
                link = device_link_add(&pdev->dev, &nhi->pdev->dev,