From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: <linux-usb@vger.kernel.org>, <gregkh@linuxfoundation.org>
Cc: mika.westerberg@linux.intel.com,
Mathias Nyman <mathias.nyman@linux.intel.com>,
Rajaram Regupathy <rajaram.regupathy@intel.com>,
Saranya Gopal <saranya.gopal@intel.com>
Subject: [PATCH 4/4] thunderbolt: Don't create device link from USB4 Host Interface to USB3 xHC host
Date: Wed, 19 Jun 2024 16:03:05 +0300 [thread overview]
Message-ID: <20240619130305.2617784-5-mathias.nyman@linux.intel.com> (raw)
In-Reply-To: <20240619130305.2617784-1-mathias.nyman@linux.intel.com>
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 <rajaram.regupathy@intel.com>
Reported-by: Saranya Gopal <saranya.gopal@intel.com>
Tested-by: Saranya Gopal <saranya.gopal@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
---
drivers/thunderbolt/acpi.c | 40 ++++++++++----------------------------
1 file changed, 10 insertions(+), 30 deletions(-)
diff --git a/drivers/thunderbolt/acpi.c b/drivers/thunderbolt/acpi.c
index c9b6bb46111c..d2a0054217da 100644
--- a/drivers/thunderbolt/acpi.c
+++ b/drivers/thunderbolt/acpi.c
@@ -32,40 +32,20 @@ static acpi_status tb_acpi_add_link(acpi_handle handle, u32 level, void *data,
goto out_put;
/*
- * Try to find physical device walking upwards to the hierarcy.
- * We need to do this because the xHCI driver might not yet be
- * bound so the USB3 SuperSpeed ports are not yet created.
+ * Ignore USB3 ports here as USB core will set up device links between
+ * tunneled USB3 devices and NHI host during USB device creation.
+ * USB3 ports might not even have a physical device yet if xHCI driver
+ * isn't bound yet.
*/
- do {
- dev = acpi_get_first_physical_node(adev);
- if (dev)
- break;
-
- adev = acpi_dev_parent(adev);
- } while (adev);
-
- /*
- * Check that the device is PCIe. This is because USB3
- * SuperSpeed ports have this property and they are not power
- * managed with the xHCI and the SuperSpeed hub so we create the
- * link from xHCI instead.
- */
- while (dev && !dev_is_pci(dev))
- dev = dev->parent;
-
- if (!dev)
+ dev = acpi_get_first_physical_node(adev);
+ if (!dev || !dev_is_pci(dev))
goto out_put;
- /*
- * Check that this actually matches the type of device we
- * expect. It should either be xHCI or PCIe root/downstream
- * port.
- */
+ /* Check that this matches a PCIe root/downstream port. */
pdev = to_pci_dev(dev);
- if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI ||
- (pci_is_pcie(pdev) &&
- (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT ||
- pci_pcie_type(pdev) == PCI_EXP_TYPE_DOWNSTREAM))) {
+ if (pci_is_pcie(pdev) &&
+ (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT ||
+ pci_pcie_type(pdev) == PCI_EXP_TYPE_DOWNSTREAM)) {
const struct device_link *link;
/*
--
2.25.1
next prev parent reply other threads:[~2024-06-19 13:01 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 13:03 [PATCH 0/4] Add device links between tunneled USB3 devices and USB4 Host Mathias Nyman
2024-06-19 13:03 ` [PATCH 1/4] xhci: Add USB4 tunnel detection for USB3 devices on Intel hosts Mathias Nyman
2024-06-19 13:03 ` [PATCH 2/4] usb: Add tunneled parameter to usb device structure Mathias Nyman
2024-06-19 13:03 ` [PATCH 3/4] usb: acpi: add device link between tunneled USB3 device and USB4 Host Interface Mathias Nyman
2024-06-19 13:03 ` Mathias Nyman [this message]
2024-06-20 6:41 ` [PATCH 0/4] Add device links between tunneled USB3 devices and USB4 Host Mika Westerberg
2024-06-20 18:36 ` Mario Limonciello
2024-06-21 6:19 ` Mika Westerberg
2024-06-21 16:30 ` Mario Limonciello
2024-06-24 4:59 ` Mika Westerberg
2024-06-24 18:41 ` Mario Limonciello
2024-06-25 5:02 ` Mika Westerberg
2024-06-25 14:37 ` Mathias Nyman
2024-06-25 14:45 ` Mika Westerberg
2024-06-25 14:55 ` Mario Limonciello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240619130305.2617784-5-mathias.nyman@linux.intel.com \
--to=mathias.nyman@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=rajaram.regupathy@intel.com \
--cc=saranya.gopal@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox