[PATCH v3 6/8] thunderbolt: Increase the lane adapter link-up timeout value
From: Chunfeng Yun
Date: Mon Nov 23 2026 - 06:38:45 EST
when plug into a USB3 device into USB4 hub's downstream facing port
to trigger USB4 driver wakeup, encounter the lane link up timeout
issue, then cause USB3 hub disconnect:
thunderbolt NVDA8100:00: 0:1: failed to reach state TB_PORT_UP. Ignoring port...
thunderbolt NVDA8100:00: 0:1: lost during suspend, disconnecting
thunderbolt NVDA8100:00: 0:4 <-> 1:16 (USB3): deactivating
thunderbolt NVDA8100:00: deactivating USB3 Down path from 0:4 to 1:16
thunderbolt NVDA8100:00: deactivating USB3 Up path from 1:16 to 0:4
thunderbolt NVDA8100:00: 0: TMU: mode change off -> bi-directional, HiFi requested
thunderbolt NVDA8100:00: 0: TMU: mode set to: bi-directional, HiFi
thunderbolt NVDA8100:00: 0:5: DP IN resource available after hotplug
thunderbolt NVDA8100:00: looking for DP IN <-> DP OUT pairs:
...
thunderbolt 0-0:1.1: retimer disconnected
thunderbolt 0-1:1.1: retimer disconnected
thunderbolt 0-1: device disconnected
usb 2-1: USB disconnect, device number 5
Completes link training at ~1.48s (with two retimer) and transitions
to TB_PORT_UP after change the timeout to 2s;
In the USB4 spec, Phase 5 (Link Equalization) alone is allowed up to
1000 ms. When add tPhase2~4 (200 ms), and retimer transaction delays
(tCmdResponse = 50 ms), the physical link is allowed by spec to take
1200 ms to 1500 ms+ to complete initialization.
Signed-off-by: Chunfeng Yun <chunfeng.yun@xxxxxxxxxxxx>
---
v3: update commit message and kernel-doc
v2: change timeout from 2.5s to 2s
---
drivers/thunderbolt/switch.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 7ff3da79da76..97e3fd8cdc0c 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -486,7 +486,7 @@ int tb_port_state(struct tb_port *port)
* @port: Port to wait
* @wait_if_unplugged: Wait also when port is unplugged
*
- * Wait up to 1 second for a port to reach state TB_PORT_UP. If
+ * Wait up to 2 seconds for a port to reach state TB_PORT_UP. If
* wait_if_unplugged is set then we also wait if the port is in state
* TB_PORT_UNPLUGGED (it takes a while for the device to be registered after
* switch resume). Otherwise we only wait if a device is registered but the link
@@ -494,13 +494,13 @@ int tb_port_state(struct tb_port *port)
*
* Return:
* * %0 - If the port is not connected or failed to reach
- * state %TB_PORT_UP within one second.
+ * state %TB_PORT_UP within two seconds.
* * %1 - If the port is connected and in state %TB_PORT_UP.
* * Negative errno - An error occurred.
*/
int tb_wait_for_port(struct tb_port *port, bool wait_if_unplugged)
{
- int retries = 10;
+ int retries = 20;
int state;
if (!port->cap_phy) {
tb_port_WARN(port, "does not have PHY\n");
--
2.45.2