summaryrefslogtreecommitdiffstats
path: root/drivers/thunderbolt
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2024-10-24 11:26:53 +0200
committerMika Westerberg <mika.westerberg@linux.intel.com>2024-10-29 06:48:42 +0100
commitbf791751162ac875a9439426d13f8d4d18151549 (patch)
tree6c40dbf635618650fdd3a947552ec247b9143cf6 /drivers/thunderbolt
parentLinux 6.12-rc5 (diff)
downloadlinux-bf791751162ac875a9439426d13f8d4d18151549.tar.xz
linux-bf791751162ac875a9439426d13f8d4d18151549.zip
thunderbolt: Add only on-board retimers when !CONFIG_USB4_DEBUGFS_MARGINING
Normally there is no need to enumerate retimers on the other side of the cable. This is only needed in special cases where user wants to run receiver lane margining against the downstream facing port of a retimer. Furthermore this might confuse the userspace tools such as fwupd because it cannot read the information it expects from these retimers. Fix this by changing the retimer enumeration code to add only on-board retimers when CONFIG_USB4_DEBUGFS_MARGINING is not enabled. Reported-by: AceLan Kao <acelan.kao@canonical.com> Tested-by: AceLan Kao <acelan.kao@canonical.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219420 Cc: stable@vger.kernel.org Fixes: ff6ab055e070 ("thunderbolt: Add receiver lane margining support for retimers") Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt')
-rw-r--r--drivers/thunderbolt/retimer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/thunderbolt/retimer.c b/drivers/thunderbolt/retimer.c
index 721319329afa..bdf641489f82 100644
--- a/drivers/thunderbolt/retimer.c
+++ b/drivers/thunderbolt/retimer.c
@@ -531,6 +531,8 @@ int tb_retimer_scan(struct tb_port *port, bool add)
max = i;
ret = 0;
+ if (!IS_ENABLED(CONFIG_USB4_DEBUGFS_MARGINING))
+ max = min(last_idx, max);
/* Add retimers if they do not exist already */
for (i = 1; i <= max; i++) {