Skip to content

Commit 3fe9574

Browse files
committed
thunderbolt: Do not touch CL state configuration during discovery
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 also keep the TMU settings untouched because we do not change the TMU configuration when CL states are not enabled. Reported-by: Koba Ko <[email protected]> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7831 Cc: [email protected] # v6.0+ Acked-By: Yehezkel Bernat <[email protected]> Signed-off-by: Mika Westerberg <[email protected]>
1 parent b6d572a commit 3fe9574

File tree

1 file changed

+12
-5
lines changed
  • drivers/thunderbolt

1 file changed

+12
-5
lines changed

drivers/thunderbolt/tb.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,7 @@ static void tb_scan_port(struct tb_port *port)
737737
{
738738
struct tb_cm *tcm = tb_priv(port->sw->tb);
739739
struct tb_port *upstream_port;
740+
bool discovery = false;
740741
struct tb_switch *sw;
741742
int ret;
742743

@@ -804,8 +805,10 @@ static void tb_scan_port(struct tb_port *port)
804805
* tunnels and know which switches were authorized already by
805806
* the boot firmware.
806807
*/
807-
if (!tcm->hotplug_active)
808+
if (!tcm->hotplug_active) {
808809
dev_set_uevent_suppress(&sw->dev, true);
810+
discovery = true;
811+
}
809812

810813
/*
811814
* At the moment Thunderbolt 2 and beyond (devices with LC) we
@@ -835,10 +838,14 @@ static void tb_scan_port(struct tb_port *port)
835838
* CL0s and CL1 are enabled and supported together.
836839
* Silently ignore CLx enabling in case CLx is not supported.
837840
*/
838-
ret = tb_switch_enable_clx(sw, TB_CL1);
839-
if (ret && ret != -EOPNOTSUPP)
840-
tb_sw_warn(sw, "failed to enable %s on upstream port\n",
841-
tb_switch_clx_name(TB_CL1));
841+
if (discovery) {
842+
tb_sw_dbg(sw, "discovery, not touching CL states\n");
843+
} else {
844+
ret = tb_switch_enable_clx(sw, TB_CL1);
845+
if (ret && ret != -EOPNOTSUPP)
846+
tb_sw_warn(sw, "failed to enable %s on upstream port\n",
847+
tb_switch_clx_name(TB_CL1));
848+
}
842849

843850
if (tb_switch_is_clx_enabled(sw, TB_CL1))
844851
/*

0 commit comments

Comments
 (0)