Skip to content

Commit f20998f

Browse files
matnymangregkh
authored andcommitted
thunderbolt: Don't create device link from USB4 Host Interface to USB3 xHC host
USB core will create device links between tunneled USB3 devices and USB4 Host Interface during USB device creation. Those device links are removed with the tunneled USB3 devices, allowing USB4 Host Interface to runtime suspend if USB3 tunnels are not used. So remove device link creation between USB4 Host Interface and USB3 xHC during NHI probe Reported-by: Rajaram Regupathy <[email protected]> Reported-by: Saranya Gopal <[email protected]> Tested-by: Saranya Gopal <[email protected]> Acked-by: Mika Westerberg <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f1bfb4a commit f20998f

File tree

1 file changed

+10
-30
lines changed

1 file changed

+10
-30
lines changed

drivers/thunderbolt/acpi.c

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,20 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data,
3232
goto out_put;
3333

3434
/*
35-
* Try to find physical device walking upwards to the hierarcy.
36-
* We need to do this because the xHCI driver might not yet be
37-
* bound so the USB3 SuperSpeed ports are not yet created.
35+
* Ignore USB3 ports here as USB core will set up device links between
36+
* tunneled USB3 devices and NHI host during USB device creation.
37+
* USB3 ports might not even have a physical device yet if xHCI driver
38+
* isn't bound yet.
3839
*/
39-
do {
40-
dev = acpi_get_first_physical_node(adev);
41-
if (dev)
42-
break;
43-
44-
adev = acpi_dev_parent(adev);
45-
} while (adev);
46-
47-
/*
48-
* Check that the device is PCIe. This is because USB3
49-
* SuperSpeed ports have this property and they are not power
50-
* managed with the xHCI and the SuperSpeed hub so we create the
51-
* link from xHCI instead.
52-
*/
53-
while (dev && !dev_is_pci(dev))
54-
dev = dev->parent;
55-
56-
if (!dev)
40+
dev = acpi_get_first_physical_node(adev);
41+
if (!dev || !dev_is_pci(dev))
5742
goto out_put;
5843

59-
/*
60-
* Check that this actually matches the type of device we
61-
* expect. It should either be xHCI or PCIe root/downstream
62-
* port.
63-
*/
44+
/* Check that this matches a PCIe root/downstream port. */
6445
pdev = to_pci_dev(dev);
65-
if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI ||
66-
(pci_is_pcie(pdev) &&
67-
(pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT ||
68-
pci_pcie_type(pdev) == PCI_EXP_TYPE_DOWNSTREAM))) {
46+
if (pci_is_pcie(pdev) &&
47+
(pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT ||
48+
pci_pcie_type(pdev) == PCI_EXP_TYPE_DOWNSTREAM)) {
6949
const struct device_link *link;
7050

7151
/*

0 commit comments

Comments
 (0)