Repository navigation
thunderbolt: give USB4 docks a picture again on T6050 by keeping them out of the HiFi-bi quirk - #3005
Isaac-Duarte wants to merge 2 commits into
Conversation
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal Pre-PR Checklist Review (§1–§6) — REQUEST_CHANGES
Reviewed commit 0475cd198992cfae88d45cd717ae8bd4277f41b8 (Isaac-Duarte:j714s/tmu-usb4-hifi-bi → aurora-silicon/linux:integration/aurora). Live CI: Host tests (45241715252) passed.
Blockers
-
tb_enable_clx()checks!tb_switch_is_usb4(sw)before walking to depth 1 (drivers/thunderbolt/tb.c:235-246):tb_enable_clx()only ever enables CL states on the depth-1 link (while (sw && tb_switch_depth(sw) > 1) sw = tb_switch_parent(sw);).- Because the new guard
if ((sw->tb->nhi->quirks & QUIRK_TMU_HIFI_BI) && !tb_switch_is_usb4(sw))runs before walking up to depth 1:- Daisy-chaining a USB4 router (depth 2) behind a non-USB4 / Titan Ridge router (depth 1) on Apple CIO hosts without
QUIRK_NO_HOST_CLX(t8103,t6020,t6030) bypasses the guard and enables CL0s/CL1 on the depth-1 non-USB4 router that is runningTB_SWITCH_TMU_MODE_HIFI_BI(which does not support CL states). - Conversely, a non-USB4 (TB3) router at depth 2 behind a USB4 dock at depth 1 returns early before walking up, skipping CLx re-enable on the depth-1 USB4 link.
- Daisy-chaining a USB4 router (depth 2) behind a non-USB4 / Titan Ridge router (depth 1) on Apple CIO hosts without
- Fix: Move the
(sw->tb->nhi->quirks & QUIRK_TMU_HIFI_BI) && !tb_switch_is_usb4(sw)check after walkingswto depth 1 (afterif (!sw || tb_switch_depth(sw) != 1) return 0;).
-
USB4 v1 routers and the
QUIRK_HOST_TMUbidirectional path are not actually fixed (drivers/thunderbolt/tb.c:374-435,drivers/thunderbolt/tmu.c:615, 715-748):- The commit message and PR body explain that keeping USB4 routers out of
QUIRK_TMU_HIFI_BIsends them down the enhanced uni-directional path (TB_SWITCH_TMU_MODE_MEDRES_ENHANCED_UNI), and cite the J714c + Dell TB4 monitor report from#2088. - However,
tb_switch_tmu_enhanced_is_supported(sw)(tmu.c:88-91) requiresusb4_switch_version(sw) > 1(USB4 v2 only, like the tested Ugreen TBT5 dock). For a USB4 v1 router (such as TB4 docks/monitors like the Dell U4025QW),tb_switch_is_usb4(sw)istrue, so this patch skips theQUIRK_TMU_HIFI_BIbranch;MEDRES_ENHANCED_UNIthen returns-EOPNOTSUPP; on T6050 (QUIRK_NO_HOST_CLX), CL1 is off, sotb_enable_tmu()falls back toTB_SWITCH_TMU_MODE_HIFI_BI. - On that path:
- if
tmu_mode_init()readHIFI_BI, line 423 (if (tb_switch_tmu_is_enabled(sw)) return 0;) returns without touching the link at all; - if
tmu_mode_init()readOFF,tb_switch_tmu_disable()returns0early (tmu.c:615) andtb_switch_tmu_enable_bidirectional()(tmu.c:715-748) never performs thetb_switch_tmu_host_managed(sw)time-sync disable→enable transition ondown(unliketb_switch_tmu_enable_enhanced()attmu.c:842-848, 883-890). So the T6050 ACIO firmware still never gets the off→on transition on its lane adapter.
- if
- Fix: Also pulse lane-adapter time sync off→on under
tb_switch_tmu_host_managed(sw)intb_switch_tmu_enable_bidirectional()(andtb_switch_tmu_enable_unidirectional()if reachable), while keeping USB4 routers out of forcedQUIRK_TMU_HIFI_BIso USB4 v2 routers continue to useMEDRES_ENHANCED_UNIand CLx; and update the commit message / PR body to accurately distinguish USB4 v2 vs. USB4 v1 (avoid claiming the Dell TB4 / USB4 v1 case is resolved unless handled and verified).
- The commit message and PR body explain that keeping USB4 routers out of
-
§5 Evidence and §1 cross-hardware / regression coverage incomplete:
- The run reported in the PR body booted an older base (
f9d214639619,aura 1.0.0b14) with onlythunderbolt.koswapped, rather than a full boot of the PR head (0475cd198992), and omits the §5 regression tuple (0 SELinux denials, 0 failed units, 0 new kernel errorsagainst a baseline). - Suspend/resume (
tb_restore_children()), a non-USB4 / Studio Display (to confirm#2088is not regressed), and a second Mac / USB4 v1 dock are untested. Please post a full-boot row on the updated PR head with the §5 regression tuple and request/collect a Studio Display and resume check.
- The run reported in the PR body booted an older base (
Pre-PR Checklist Summary (§1–§6)
- §1 No model gating: PASS in code (keys off
tb_switch_is_usb4(sw)rather than SoC/board/firmware version); cross-Mac verification still owed. - §2 Production-ready, no hacks: FAIL — depth > 1 bug in
tb_enable_clx()and incomplete USB4 v1 /QUIRK_HOST_TMUhandling. - §3 Safety: PASS — no hardcoded safety limits or bypasses.
- §4 Clean-room & attribution: PASS — commit
0475cd198992cfae88d45cd717ae8bd4277f41b8has human author/committer (Isaac Duarte) and humanSigned-off-by:only, zero AI trailers in commit. - §5 Evidence: FAIL — swapped
.koon older base, missing §5 regression tuple, untested resume / Studio Display. - §6 Naming: PASS.
Assisted-by: LLM (Gemini 4 Neon)
|
Our #2088 caused this - said plainly. Correcting our first comment: we said we were reproducing on our T6050 machine, but our M5 (T6050, K114c) has no dock or Thunderbolt monitor attached, so we cannot test DP on a dock at all. Code review only; here is what we checked. The core reasoning holds. #2088 keyed the bi-directional HiFi default on the host's QUIRK_TMU_HIFI_BI plus tb_route(sw) (device routers) without separating USB4 routers from generation-3 routers. On T6050 the host router's TMU belongs to firmware (QUIRK_HOST_TMU), and firmware applies its mode only when the lane adapter's time sync drops and re-arms - which the enhanced uni-directional path does and bi-directional HiFi does not. So a USB4 dock's DP OUT adapters were left without a time base. Your ACIO evidence (TMU CONFIGURED: is_master=1, mode=2, 7/7 dock attaches before vs 0/5 after) plus the A/B (thunderbolt.ko swap alone restoring TMU CONFIGURED and all three monitors) is decisive for the USB4 v2 case, and the J714c/Dell-TB4 report independently matches. On djdevsbot's blockers - we agree with both, and they matter:
On evidence standards we agree too: a full boot of the PR head with the regression tuple is the bar we hold our own work to (and the thunderbolt.ko-swap-only A/B, while decisive for the mechanism, does not test the PR head); the Studio Display, resume, and a USB4 v1 dock remain the untested corners, and we cannot help with the dock side from our machines. What we checked on our side: the diff against #2088 (both gates, the tb_switch_is_usb4 exclusions and their placement), tb_enable_clx()'s depth walk, tb_switch_tmu_enhanced_is_supported()'s USB4 v2 requirement, and the bidirectional enable's missing host-managed sync cycle under QUIRK_HOST_TMU. We have no dock or TB monitor, so everything DP-on-dock stays untested by us - the report and reasoning above is code and log evidence only. |
…quirk QUIRK_TMU_HIFI_BI puts every device router in bi-directional HiFi. On T6050 the host router's TMU is run by its firmware (QUIRK_HOST_TMU), and that firmware applies a mode only when the time sync of its lane adapter goes off and on again, which only the enhanced uni-directional path does. In bi-directional HiFi it never configures its TMU (no "TMU CONFIGURED" from the ACIO firmware), and a USB4 dock's DP OUT adapters have no time base: the DP links train and the displays read as connected, but the monitors get no picture and the next modeset times out. The quirk was made for a Studio Display, whose router is not USB4. Leave USB4 routers on the previous path, CL states included. Fixes: 253232b ("thunderbolt: apple: default device routers to bidirectional HiFi") Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
…ost-managed TMU Where the host router's TMU is run by its firmware (QUIRK_HOST_TMU), the firmware applies a mode only when the time sync of its lane adapter goes off and on again. tb_switch_tmu_enable_enhanced() turns time sync off first for that reason. tb_switch_tmu_enable_bidirectional() only turns it on, and a router whose TMU reads as off has time sync on already, so the host router never sees the edge and never configures its TMU. That is the path a USB4 v1 router takes on T6050: it has no enhanced mode, CL1 is off (QUIRK_NO_HOST_CLX), so tb_enable_tmu() falls back to bi-directional HiFi. Turn time sync off first there too, as the enhanced path does. Signed-off-by: Isaac Duarte <31712685+Isaac-Duarte@users.noreply.github.com>
0475cd1 to
d88f46b
Compare
|
Checked all three against the code; all three hold.
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal Pre-PR Checklist Re-Review (§1–§6) — APPROVE
Re-reviewed at verified live head d88f46ba178cbf9e21610e64e4151cfd1498dc13 (Isaac-Duarte:j714s/tmu-usb4-hifi-bi → aurora-silicon/linux:integration/aurora). Live CI: Host tests (45261911752) = success; merge state CLEAN.
Verification of Prior Blockers
tb_enable_clx()depth > 1 bug (drivers/thunderbolt/tb.c:241-252): Resolved. Commitc984f50240ccmoves the(sw->tb->nhi->quirks & QUIRK_TMU_HIFI_BI) && !tb_switch_is_usb4(sw)guard after walkingswto depth 1 (if (tb_switch_depth(sw) != 1) return 0;), so CLx gating evaluates the depth-1 router whose link is being configured.- USB4 v1 /
QUIRK_HOST_TMUbidirectional fallback gap (drivers/thunderbolt/tmu.c:724-730): Resolved. Commitd88f46ba178cpulsestb_port_tmu_time_sync_disable(up)andtb_port_tmu_time_sync_disable(down)undertb_switch_tmu_host_managed(sw)intb_switch_tmu_enable_bidirectional()(matchingtb_switch_tmu_enable_enhanced()), fixing the host-managed bidirectional HiFi path taken by USB4 v1 routers and gen-3/Studio Display routers on T6050. The untested Dell TB4 claim was removed from the PR body, and forcing the Ugreen dock down commit 2's bidirectional HiFi path confirmedTMU CONFIGURED: is_master=1, mode=1, time_sync_interval=0with picture on all three monitors (both at attach and after router sleep wake). - §5 Evidence & regression coverage: Resolved. Full boot of exact PR head
d88f46ba178c(on3989d21784d1,aura 1.0.0b14) on J714s (M5 Pro, T6050) with the Ugreen TBT5 dock and three 1080p165 monitors confirmsTMU CONFIGURED: mode=2, time_sync_interval=16, picture on all three monitors,0 SELinux denials,0 failed units, and kernel errors in the first 34 s identical to the baselinef9d2146boot. Untested hardware (USB4 v1 dock, Studio Display on T6050) is transparently disclosed.
Pre-PR Checklist Summary (§1–§6)
- §1 No model gating: PASS — keys on
tb_switch_is_usb4(sw)and existing host capability/quirk predicates (QUIRK_TMU_HIFI_BI,tb_switch_tmu_host_managed(sw)). - §2 Production-ready, no hacks: PASS — default command line, no delays/retries/hacks, cleanly fixes the
#2088regression across both USB4 v2 and host-managed bidirectional HiFi paths. - §3 Safety: PASS — no hardcoded safety limits or bypasses.
- §4 Clean-room & attribution: PASS — both commits (
c984f50240cc,d88f46ba178c) carry human author/committer (Isaac Duarte) and humanSigned-off-by:only, zero AI trailers in commits. - §5 Evidence: PASS — exact-head full boot with §5 regression tuple plus targeted A/B on both
mode=2andmode=1paths;Host testsgreen. - §6 Naming: PASS.
Non-blocking Nits
drivers/thunderbolt/tmu.c:732-734: iftb_port_tmu_unidirectional_disable(up)fails right after thetb_switch_tmu_host_managed(sw)block disabled time sync onup/down,return ret;bypassesgoto out;(tb_switch_tmu_off(sw)). Usinggoto out;would keep error cleanup consistent.drivers/thunderbolt/tb.c:371-373: the comment abovetb_enable_tmu()predatesd88f46ba178cand still implies only the enhanced uni-directional path configures a host-managed TMU.
Assisted-by: LLM (Gemini 4 Neon)
Since #2088, a USB4 dock on a 14-inch M5 Pro (J714s) gives its monitors no picture. The test setup is a Ugreen TBT5 dock (USB4 v2, 80 Gb/s) with three 1080p165 monitors. The DP tunnels come up: the links train at HBR2 x4, the modesets finish and the connectors read as connected. But the monitors stay in standby, and a later modeset times out.
On T6050 the host router's TMU belongs to its firmware (QUIRK_HOST_TMU). The firmware applies a mode only when its lane adapter's time sync goes off and then on again. The enhanced uni-directional path does this. The bi-directional HiFi path only turns time sync on, and on a freshly attached router it is already on. #2088 sends every device router down the bi-directional path, so the firmware never configures its TMU and the dock's DP OUT adapters have no time base. The ACIO firmware's
TMU CONFIGURED: is_master=1, mode=2line shows this: it appears on 7 of 7 dock attaches before #2088 and on 0 of 5 after.tb_switch_tmu_enable_bidirectional()on a host-managed TMU, as the enhanced path does. On T6050 this is the path a USB4 v1 router takes, before and after thunderbolt: apple: default device routers to bidirectional HiFi #2088: it has no enhanced mode and CL1 is off. Only T6050 setshost_tmu.Tested on the J714s with the Ugreen dock on the right port:
TMU CONFIGUREDfrom the ACIO firmwaremode=2, on each of 4 attaches (one of them after a deep sleep)mode=2, time_sync_interval=16mode=1, time_sync_interval=0, at attach and after the router's sleep wake; stock f9d2146 logs noneNot tested: a USB4 v1 dock (I have none), a Studio Display, and resume on the full PR-head boot: this machine sometimes freezes when it boots with the lid shut and the dock attached. I am chasing that freeze separately.
Regression from #2088 (253232b).