Skip to contentSkip to conversation

thunderbolt: Two fixes for reported display issues

PATCH In review Mika Westerberg 2 participants 5 messages May 25, 2023 – May 29, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover thunderbolt: Two fixes for reported display issues

Hi all,

This series includes two fixes for the display related issues reported by Koba Ko.

Mika Westerberg (2):
thunderbolt: Increase DisplayPort Connection Manager handshake timeout
thunderbolt: Do not touch CL state configuration during discovery

 drivers/thunderbolt/tb.c     | 17 ++++++++++++-----
 drivers/thunderbolt/tunnel.c |  2 +-
 2 files changed, 13 insertions(+), 6 deletions(-)
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/2 thunderbolt: Increase DisplayPort Connection Manager handshake timeout

It turns out that when plugging in VGA cable through USB-C to VGA/DVI dongle the Connection Manager handshake can take longer time, at least on Intel Titan Ridge based docks such as Dell WD91TB. This leads to following error in the dmesg:

thunderbolt 0000:00:0d.3: 3:10: DP tunnel activation failed, aborting

and the display stays blank (because we failed to establish the tunnel). For this reason increase the timeout to 3s.

---
 drivers/thunderbolt/tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thunderbolt/tunnel.c +1 -1
index 3bf2628a5dcd..3ebd32b897a0 100644
@@ -531,7 +531,7 @@ static int tb_dp_xchg_caps(struct tb_tunnel *tunnel)
 	 * Perform connection manager handshake between IN and OUT ports
 	 * before capabilities exchange can take place.
 	 */
-	ret = tb_dp_cm_handshake(in, out, 1500);
+	ret = tb_dp_cm_handshake(in, out, 3000);
 	if (ret)
 		return ret;
 
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/2 thunderbolt: Do not touch CL state configuration during discovery

In reply to Mika Westerberg

If the boot firmware has already established tunnels, especially ones that have special requirements from the link such as DisplayPort, we should not blindly enable CL states (nor change the TMU configuration). Otherwise the existing tunnels may not work as expected.

For this reason, skip the CL state enabling when we go over the existing topology. This will als keep the TMU settings untouched because we do not change the TMU configururation when CL states are not enabled.

---
 drivers/thunderbolt/tb.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/thunderbolt/tb.c +12 -5
index 7bfbc9ca9ba4..c1af712ca728 100644
@@ -737,6 +737,7 @@ static void tb_scan_port(struct tb_port *port)
 {
 	struct tb_cm *tcm = tb_priv(port->sw->tb);
 	struct tb_port *upstream_port;
+	bool discovery = false;
 	struct tb_switch *sw;
 	int ret;
 
@@ -804,8 +805,10 @@ static void tb_scan_port(struct tb_port *port)
 	 * tunnels and know which switches were authorized already by
 	 * the boot firmware.
 	 */
-	if (!tcm->hotplug_active)
+	if (!tcm->hotplug_active) {
 		dev_set_uevent_suppress(&sw->dev, true);
+		discovery = true;
+	}
 
 	/*
 	 * At the moment Thunderbolt 2 and beyond (devices with LC) we
@@ -835,10 +838,14 @@ static void tb_scan_port(struct tb_port *port)
 	 * CL0s and CL1 are enabled and supported together.
 	 * Silently ignore CLx enabling in case CLx is not supported.
 	 */
-	ret = tb_switch_enable_clx(sw, TB_CL1);
-	if (ret && ret != -EOPNOTSUPP)
-		tb_sw_warn(sw, "failed to enable %s on upstream port\n",
-			   tb_switch_clx_name(TB_CL1));
+	if (discovery) {
+		tb_sw_dbg(sw, "discovery, not touching CL states\n");
+	} else {
+		ret = tb_switch_enable_clx(sw, TB_CL1);
+		if (ret && ret != -EOPNOTSUPP)
+			tb_sw_warn(sw, "failed to enable %s on upstream port\n",
+				   tb_switch_clx_name(TB_CL1));
+	}
 
 	if (tb_switch_is_clx_enabled(sw, TB_CL1))
 		/*
Signature · 1 line
2.39.2
maintainer Acked-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] thunderbolt: Do not touch CL state configuration during discovery

Quoted 8 lines · Mika Westerberg

If the boot firmware has already established tunnels, especially ones that have special requirements from the link such as DisplayPort, we should not blindly enable CL states (nor change the TMU configuration). Otherwise the existing tunnels may not work as expected.

For this reason, skip the CL state enabling when we go over the existing topology. This will als keep the TMU settings untouched because we do

^ also

Quoted 1 line

not change the TMU configururation when CL states are not enabled.

^ configuration

For the both patches in the series:

#4 lore raw

Re: [PATCH 2/2] thunderbolt: Do not touch CL state configuration during discovery

Quoted 10 lines · Yehezkel Bernat
Quoted 8 lines · Mika Westerberg

If the boot firmware has already established tunnels, especially ones that have special requirements from the link such as DisplayPort, we should not blindly enable CL states (nor change the TMU configuration). Otherwise the existing tunnels may not work as expected.

For this reason, skip the CL state enabling when we go over the existing topology. This will als keep the TMU settings untouched because we do

Quoted 8 lines

^ also

Quoted 1 line

not change the TMU configururation when CL states are not enabled.

^ configuration

For the both patches in the series:

Thanks! Fixed the typos and applied both to thunderbolt.git/fixes.