diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-02 14:25:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-02 14:25:05 +0100 |
commit | 21bea26c848e056e58e01448db41fabd47168c73 (patch) | |
tree | 72fbed5c6cb9cf6372a573d63f260bce5ba92bfa /drivers/thunderbolt/switch.c | |
parent | 1760bfa7d7ca490cf8a61fe50ddeb1769cadd89e (diff) | |
parent | 04b99eac389adc6485f7913d83ec9ed68bbc8326 (diff) |
Merge tag 'thunderbolt-for-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt into char-misc-next
Mika writes:
thunderbolt: Changes for v6.8 merge window
This includes following USB4/Thunderbolt changes for the v6.8 merge
window:
- Intel Lunar Lake support
- PCIe tunneling improvements
- DisplayPort tunneling improvements
- Asymmetric switching improvements
- Couple of minor fixes and cleanups.
All these have been in linux-next with no reported issues.
* tag 'thunderbolt-for-v6.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt:
thunderbolt: Reduce retry timeout to speed up boot for some devices
thunderbolt: Keep link as asymmetric if preferred by hardware
thunderbolt: Add support for Intel Lunar Lake
thunderbolt: Disable PCIe extended encapsulation upon teardown properly
thunderbolt: Make PCIe tunnel setup and teardown follow CM guide
thunderbolt: Improve logging when DisplayPort resource is added due to hotplug
thunderbolt: Use tb_dp_read_cap() to read DP_COMMON_CAP as well
thunderbolt: Disable CL states only when actually needed
thunderbolt: Transition link to asymmetric only when both sides support it
thunderbolt: Log XDomain link speed and width
thunderbolt: Move width_name() helper to tb.h
thunderbolt: Handle lane bonding of Gen 4 XDomain links properly
thunderbolt: Unwind TMU configuration if tb_switch_set_tmu_mode_params() fails
thunderbolt: Remove duplicated re-assignment of pointer 'out'
Diffstat (limited to 'drivers/thunderbolt/switch.c')
-rw-r--r-- | drivers/thunderbolt/switch.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/drivers/thunderbolt/switch.c b/drivers/thunderbolt/switch.c index 44e9b09de47a..900114ba4371 100644 --- a/drivers/thunderbolt/switch.c +++ b/drivers/thunderbolt/switch.c @@ -941,22 +941,6 @@ int tb_port_get_link_generation(struct tb_port *port) } } -static const char *width_name(enum tb_link_width width) -{ - switch (width) { - case TB_LINK_WIDTH_SINGLE: - return "symmetric, single lane"; - case TB_LINK_WIDTH_DUAL: - return "symmetric, dual lanes"; - case TB_LINK_WIDTH_ASYM_TX: - return "asymmetric, 3 transmitters, 1 receiver"; - case TB_LINK_WIDTH_ASYM_RX: - return "asymmetric, 3 receivers, 1 transmitter"; - default: - return "unknown"; - } -} - /** * tb_port_get_link_width() - Get current link width * @port: Port to check (USB4 or CIO) @@ -2769,7 +2753,7 @@ static void tb_switch_link_init(struct tb_switch *sw) return; tb_sw_dbg(sw, "current link speed %u.0 Gb/s\n", sw->link_speed); - tb_sw_dbg(sw, "current link width %s\n", width_name(sw->link_width)); + tb_sw_dbg(sw, "current link width %s\n", tb_width_name(sw->link_width)); bonded = sw->link_width >= TB_LINK_WIDTH_DUAL; @@ -2789,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)); } /** @@ -3029,7 +3026,7 @@ int tb_switch_set_link_width(struct tb_switch *sw, enum tb_link_width width) tb_switch_update_link_attributes(sw); - tb_sw_dbg(sw, "link width set to %s\n", width_name(width)); + tb_sw_dbg(sw, "link width set to %s\n", tb_width_name(width)); return ret; } |