Skip to content

Commit 75749d2

Browse files
committed
thunderbolt: Scan retimers after device router has been enumerated
Thomas reported connection issues on AMD system with Pluggable UD-4VPD dock. After some experiments it looks like the device has some sort of internal timeout that triggers reconnect. This is completely against the USB4 spec, as there is no requirement for the host to enumerate the device right away or even at all. In Linux case the delay is caused by scanning of retimers on the link so we can work this around by doing the scanning after the device router has been enumerated. Reported-by: Thomas Lynema <lyz27@yahoo.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219748 Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 72cef52 commit 75749d2

File tree

1 file changed

+14
-2
lines changed
  • drivers/thunderbolt

1 file changed

+14
-2
lines changed

drivers/thunderbolt/tb.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,11 +1305,15 @@ static void tb_scan_port(struct tb_port *port)
13051305
goto out_rpm_put;
13061306
}
13071307

1308-
tb_retimer_scan(port, true);
1309-
13101308
sw = tb_switch_alloc(port->sw->tb, &port->sw->dev,
13111309
tb_downstream_route(port));
13121310
if (IS_ERR(sw)) {
1311+
/*
1312+
* Make the downstream retimers available even if there
1313+
* is no router connected.
1314+
*/
1315+
tb_retimer_scan(port, true);
1316+
13131317
/*
13141318
* If there is an error accessing the connected switch
13151319
* it may be connected to another domain. Also we allow
@@ -1359,6 +1363,14 @@ static void tb_scan_port(struct tb_port *port)
13591363
upstream_port = tb_upstream_port(sw);
13601364
tb_configure_link(port, upstream_port, sw);
13611365

1366+
/*
1367+
* Scan for downstream retimers. We only scan them after the
1368+
* router has been enumerated to avoid issues with certain
1369+
* Pluggable devices that expect the host to enumerate them
1370+
* within certain timeout.
1371+
*/
1372+
tb_retimer_scan(port, true);
1373+
13621374
/*
13631375
* CL0s and CL1 are enabled and supported together.
13641376
* Silently ignore CLx enabling in case CLx is not supported.

0 commit comments

Comments
 (0)