summaryrefslogtreecommitdiff
path: root/drivers/thunderbolt/switch.c
diff options
context:
space:
mode:
authorGil Fine <gil.fine@linux.intel.com>2023-12-04 16:14:58 +0300
committerMika Westerberg <mika.westerberg@linux.intel.com>2023-12-22 13:58:39 +0300
commitba2a2a86de04e67bb1d7f8251894eb11eed062e9 (patch)
tree3f46dee63826431f3cb3e2bb1a1243b1f20ea7bd /drivers/thunderbolt/switch.c
parent2cd3da4e37453019e21a486d9de3144f46b4fdf7 (diff)
downloadlinux-ba2a2a86de04e67bb1d7f8251894eb11eed062e9.tar.xz
thunderbolt: Keep link as asymmetric if preferred by hardware
In case of the link is brought up as asymmetric (due to hardware preference), we honor that and don't transition it to symmetric, unless a router with symmetric link got plugged below, in the topology (and a bandwidth allows transition to symmetric). Signed-off-by: Gil Fine <gil.fine@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r--drivers/thunderbolt/switch.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c
index 7873b173a351..e5a622b9acc3 100644
--- a/drivers/thunderbolt/switch.c
+++ b/drivers/thunderbolt/switch.c
@@ -2773,6 +2773,19 @@ static void tb_switch_link_init(struct tb_switch *sw)
if (down->dual_link_port)
down->dual_link_port->bonded = bonded;
tb_port_update_credits(down);
+
+ if (tb_port_get_link_generation(up) < 4)
+ return;
+
+ /*
+ * Set the Gen 4 preferred link width. This is what the router
+ * prefers when the link is brought up. If the router does not
+ * support asymmetric link configuration, this also will be set
+ * to TB_LINK_WIDTH_DUAL.
+ */
+ sw->preferred_link_width = sw->link_width;
+ tb_sw_dbg(sw, "preferred link width %s\n",
+ tb_width_name(sw->preferred_link_width));
}
/**