[SRU] [I/Unstable/OEM-5.13] [PATCH 7/7] thunderbolt: Fix port linking by checking all adapters

Kai-Heng Feng kai.heng.feng at canonical.com
Wed Aug 25 05:23:35 UTC 2021


From: Sanjay R Mehta <sanju.mehta at amd.com>

BugLink: https://bugs.launchpad.net/bugs/1941036

In tb_switch_default_link_ports(), while linking of ports,
only odd-numbered ports (1,3,5..) are considered and even-numbered
ports are not considered.

AMD host router has lane adapters at 2 and 3 and link ports at adapter 2
is not considered due to which lane bonding gets disabled.

Hence added a fix such that all ports are considered during
linking of ports.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar at amd.com>
Signed-off-by: Sanjay R Mehta <sanju.mehta at amd.com>
Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
(cherry picked from commit 42716425ad7e1b6529ec61c260c11176841f4b5f linux-next)
Signed-off-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
---
 drivers/thunderbolt/switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 344402d1cf9c4..7c265a75f5ccd 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -2334,7 +2334,7 @@ static void tb_switch_default_link_ports(struct tb_switch *sw)
 {
 	int i;
 
-	for (i = 1; i <= sw->config.max_port_number; i += 2) {
+	for (i = 1; i <= sw->config.max_port_number; i++) {
 		struct tb_port *port = &sw->ports[i];
 		struct tb_port *subordinate;
 
-- 
2.32.0




More information about the kernel-team mailing list