[PATCH v2 10/22] thunderbolt: Unlock host router ports during startup

Sven Peter sven at kernel.org
Sun Sep 6 11:36:33 PDT 2026


The downstream ports of the host router may still be locked after a
reset. Unlock them when the software connection manager starts before
scanning for any connected devices.

Signed-off-by: Sven Peter <sven at kernel.org>
---
 drivers/thunderbolt/tb.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index 47753a5c0f2e..bf1c192ec10a 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -3016,6 +3016,7 @@ static int tb_scan_finalize_switch(struct device *dev, void *data)
 static int tb_start(struct tb *tb, bool reset)
 {
 	struct tb_cm *tcm = tb_priv(tb);
+	struct tb_port *port;
 	bool discover = true;
 	int ret;
 
@@ -3049,6 +3050,14 @@ static int tb_start(struct tb *tb, bool reset)
 		return dev_err_probe(tb->nhi->dev, ret, "failed to add host router\n");
 	}
 
+	/* Make all host router downstream ports accessible to the CM. */
+	tb_switch_for_each_port(tb->root_switch, port) {
+		if (!tb_port_is_null(port))
+			continue;
+		if (tb_port_unlock(port))
+			tb_port_warn(port, "failed to unlock port\n");
+	}
+
 	/*
 	 * To support highest CLx state, we set host router's TMU to
 	 * Normal mode.

-- 
2.55.0





More information about the linux-arm-kernel mailing list