From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: linux-usb@vger.kernel.org
Cc: Yehezkel Bernat <YehezkelShB@gmail.com>,
Lukas Wunner <lukas@wunner.de>,
Andreas Noever <andreas.noever@gmail.com>,
Alan Borzeszkowski <alan.borzeszkowski@linux.intel.com>,
Pooja Katiyar <pooja.katiyar@intel.com>,
Rene Sapiens <rene.sapiens@linux.intel.com>,
Gil Fine <gil.fine@linux.intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [PATCH 4/8] thunderbolt: Activate path hops from source to destination
Date: Tue, 12 May 2026 14:29:51 +0200 [thread overview]
Message-ID: <20260512122955.271688-5-mika.westerberg@linux.intel.com> (raw)
In-Reply-To: <20260512122955.271688-1-mika.westerberg@linux.intel.com>
From: Gil Fine <gil.fine@linux.intel.com>
Currently, path activation starts from the last hop (destination adapter)
and iterates backwards to the first hop (source adapter). This does not
follow the order suggested in the USB4 Connection Manager guide and could
potentially cause issues with tunnelled protocols.
Reverse the activation order to start from the first hop (source adapter)
and end at the last hop (destination adapter), as suggested in the
Connection Manager guide.
Adjust the rollback in the failure path to deactivate from the first
hop, since hops are now activated starting at the source.
Fix kernel-doc accordingly.
Signed-off-by: Gil Fine <gil.fine@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
drivers/thunderbolt/path.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/thunderbolt/path.c b/drivers/thunderbolt/path.c
index 0092b2ec7873..b2c322e76b8a 100644
--- a/drivers/thunderbolt/path.c
+++ b/drivers/thunderbolt/path.c
@@ -484,7 +484,7 @@ void tb_path_deactivate(struct tb_path *path)
* tb_path_activate() - activate a path
* @path: Path to activate
*
- * Activate a path starting with the last hop and iterating backwards. The
+ * Activate a path starting with the first hop and ending on the last hop. The
* caller must fill path->hops before calling tb_path_activate().
*
* Return: %0 on success, negative errno otherwise.
@@ -526,7 +526,7 @@ int tb_path_activate(struct tb_path *path)
}
/* Activate hops. */
- for (i = path->path_length - 1; i >= 0; i--) {
+ for (i = 0; i < path->path_length; i++) {
struct tb_regs_hop hop = { 0 };
/* If it is left active deactivate it first */
@@ -576,7 +576,7 @@ int tb_path_activate(struct tb_path *path)
res = tb_port_write(path->hops[i].in_port, &hop, TB_CFG_HOPS,
2 * path->hops[i].in_hop_index, 2);
if (res) {
- __tb_path_deactivate_hops(path, i);
+ __tb_path_deactivate_hops(path, 0);
__tb_path_deallocate_nfc(path, 0);
goto err;
}
--
2.50.1
next prev parent reply other threads:[~2026-05-12 12:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 12:29 [PATCH 0/8] thunderbolt: Make the driver follow CM guide more closely Mika Westerberg
2026-05-12 12:29 ` [PATCH 1/8] thunderbolt: Improve multi-display DisplayPort tunnel allocation Mika Westerberg
2026-05-12 12:29 ` [PATCH 2/8] thunderbolt: Don't access path config space on Lane 1 adapters in tb_switch_reset_host() Mika Westerberg
2026-05-12 12:29 ` [PATCH 3/8] thunderbolt: Fix lane bonding log when bonding not possible Mika Westerberg
2026-05-12 12:29 ` Mika Westerberg [this message]
2026-05-12 12:29 ` [PATCH 5/8] thunderbolt: Verify PCIe adapter in detect state before tunnel setup Mika Westerberg
2026-05-12 12:29 ` [PATCH 6/8] thunderbolt: Verify Router Ready bit is set after router enumeration Mika Westerberg
2026-05-12 12:29 ` [PATCH 7/8] thunderbolt: Increase timeout for Configuration Ready bit Mika Westerberg
2026-05-12 12:29 ` [PATCH 8/8] thunderbolt: Increase Notification Timeout to 255 ms for USB4 routers Mika Westerberg
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=20260512122955.271688-5-mika.westerberg@linux.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=YehezkelShB@gmail.com \
--cc=alan.borzeszkowski@linux.intel.com \
--cc=andreas.noever@gmail.com \
--cc=gil.fine@linux.intel.com \
--cc=linux-usb@vger.kernel.org \
--cc=lukas@wunner.de \
--cc=pooja.katiyar@intel.com \
--cc=rene.sapiens@linux.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