thunderbolt: Scan retimers after device router has been enumerated
Subsystems (2)
PATCH 1/2 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.
--- drivers/thunderbolt/tb.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
drivers/thunderbolt/tb.c +14 -2
@@ -1305,11 +1305,15 @@ static void tb_scan_port(struct tb_port *port) goto out_rpm_put; } -tb_retimer_scan (port, true); - sw =tb_switch_alloc (port->sw->tb, &port->sw->dev,tb_downstream_route (port));if (IS_ERR (sw)) { +/* +* Make the downstream retimers available even if there +* is no router connected. +*/ +tb_retimer_scan (port, true); +/* * If there is an error accessing the connected switch * it may be connected to another domain. Also we allow
@@ -1359,6 +1363,14 @@ static void tb_scan_port(struct tb_port *port) upstream_port =tb_upstream_port (sw);tb_configure_link (port, upstream_port, sw); +/* +* Scan for downstream retimers. We only scan them after the +* router has been enumerated to avoid issues with certain +* Pluggable devices that expect the host to enumerate them +* within certain timeout. +*/ +tb_retimer_scan (port, true); +/* * CL0s and CL1 are enabled and supported together. * Silently ignore CLx enabling in case CLx is not supported.
Signature · 1 line
2.47.2
PATCH 2/2 thunderbolt: Do not add non-active NVM if NVM upgrade is disabled for retimer
This is only used to write a new NVM in order to upgrade the retimer firmware. It does not make sense to expose it if upgrade is disabled. This also makes it consistent with the router NVM upgrade.
--- drivers/thunderbolt/retimer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/thunderbolt/retimer.c +5 -3
@@ -93,9 +93,11 @@ static int tb_retimer_nvm_add(struct tb_retimer *rt)if (ret) goto err_nvm; - ret =tb_nvm_add_non_active (nvm, nvm_write); -if (ret) - goto err_nvm; +if (!rt->no_nvm_upgrade) { + ret =tb_nvm_add_non_active (nvm, nvm_write); +if (ret) + goto err_nvm; + } rt->nvm = nvm;dev_dbg (&rt->dev,"NVM version %x.%x\n" , nvm->major, nvm->minor);
Signature · 1 line
2.47.2
Quoted 6 lines · Mika Westerberg
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.
Quoted 8 lines
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 <[email protected]>Reviewed-by Mario Limonciello <[email protected]>Signed-off-by Mika Westerberg <[email protected]>
Both patches applied to thunderbolt.git/next.