Re: [PATCH v2 11/22] thunderbolt: Find Apple VSE capability during startup
From: Joshua Peisach
Date: Mon Sep 07 2026 - 09:47:18 EST
On Sun Sep 6, 2026 at 2:36 PM EDT, Sven Peter wrote:
Only Apple Silicon host routers have the Apple vendor-specific extended
capability. Look it up when the software connection manager starts and
store its offset in the root switch.
The Apple NHI driver can then use the stored offset when programming
cable information without searching the router capabilities itself.
Signed-off-by: Sven Peter <sven@xxxxxxxxxx>
---
drivers/thunderbolt/tb.c | 4 ++++
drivers/thunderbolt/tb.h | 2 ++
drivers/thunderbolt/tb_regs.h | 1 +
3 files changed, 7 insertions(+)
diff --git a/drivers/thunderbolt/tb.c b/drivers/thunderbolt/tb.c
index bf1c192ec10a..d2832323cc36 100644
--- a/drivers/thunderbolt/tb.c
+++ b/drivers/thunderbolt/tb.c
@@ -3025,6 +3025,10 @@ static int tb_start(struct tb *tb, bool reset)
return dev_err_probe(tb->nhi->dev, PTR_ERR(tb->root_switch),
"failed to allocate host router\n");
+ ret = tb_switch_find_vse_cap(tb->root_switch, TB_VSE_CAP_APPLE);
+ if (ret > 0)
+ tb->root_switch->cap_vsec_apple = ret;
+
Nitpick: I *think* based on the surrounding code that this can be
simplified to "if (ret)"
-Josh