Re: [PATCH v2 10/22] thunderbolt: Unlock host router ports during startup
From: Mika Westerberg
Date: Tue Sep 08 2026 - 04:28:01 EST
On Sun, Sep 06, 2026 at 08:36:33PM +0200, Sven Peter wrote:
> 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@xxxxxxxxxx>
> ---
> 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. */
Nit: Drop the . from single line comments
/* Make all host router downstream ports accessible to the CM */
> + tb_switch_for_each_port(tb->root_switch, port) {
We should introduce tb_switch_for_each_null_port() at some point, not the
job of this series though.
> + 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
>