Repository navigation
soc: apple: rtkit-helper, iommu: apple-dart: adopt the T6040/T6041 MTP by its compatible - #2308
Conversation
The retained live MTP handoff (buffer inventory required, the session marked preserved, no buffer allocation after adoption) was taken only when the machine was a J614s and the MTP was apple,t6041-mtp. The DART behind it was kept in bypass by the same machine check, a fixed MMIO address and a fixed node path. The handoff form belongs to the MTP firmware, which cannot be restarted once used, not to the board: every T6040 and T6041 board has the same MTP (apple,t6041-mtp in t604x.dtsi), and the boot loader picks the retained form by the MTP compatible alone (apple,t8132-mtp or apple,t6041-mtp). Key both sides on that: - rtkit-helper: the inventory and strict-buffer rules and the preserved flag follow apple,t6041-mtp, as they already follow apple,t8132-mtp. - apple-dart: an apple,t6041-dart that the apple,t6041-mtp's iommus points to keeps its bypass for an advertised mtp-live-v1 session and refuses an invalid one, on every board. Without a handoff in the device tree nothing changes: the J616s and the T6041 boards cold-start the MTP as before. With a boot loader that hands the MTP over on those boards, Linux now adopts it instead of resetting the DART under a firmware that cannot be restarted. The J614s handoff this generalizes was written by Michal S. Fixes: 49d9477 ("soc: apple: retain the live J614s MTP handoff") Signed-off-by: Ryan Murray <[email protected]>
|
No blockers. Checked at 6f0ce98. rtkit-helper:
HW row: before u-boot#55 merges: J616s on this head plus one-shot u-boot#55. The log has "Retaining the live MTP bypass" and "adopted the running RTKit session", and no "Refusing invalid live MTP DART handoff". Keyboard and trackpad work from boot and across 3x s2idle. 0 DART faults, 0 AVC, 0 failed units. Also a J614s owner boot on the head showing the same two lines, to confirm the original board did not regress. Assisted-by: LLM (Claude:Opus 5.5) |
|
Adversarial pass at 6f0ce98: no code blockers. One problem with the test plan:
Assisted-by: LLM (Claude:Opus 5.5) |
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at verified live head 6f0ce9838d5b314b0151900d14d42078818479f1 against live integration/aurora (70a00e583b03, not superseded — commit 43f0791f35d2 only generalized the J613 bypass-handoff/suspend paths, leaving the apple,j614s checks in apple-dart.c:6211 and rtkit-helper.c:201,296,345 intact; MERGEABLE/CLEAN).
Verified Clean (§1–§4, §6)
- Code & lifetime audit (§1–§3):
apple_rtkit_helper_retained_mtp()cleanly keys theapple,rtkit-buffersrequirement,helper->preserved, andhelper->strict_buffersonapple,t6041-mtpwithin thelivebranch (leaving cold-start unchanged when noapple,rtkit-handoffproperty is present). Indrivers/iommu/apple-dart.c, replacing theapple,j614s+ hardcoded0x514800000ULL+"/mtp@514600000"checks withapple,t6041-dart+of_find_compatible_node(NULL, NULL, "apple,t6041-mtp")+iommusphandle matching is refcount-balanced (of_node_put(iommu); of_node_put(mtp);on both normal and error paths) and null-safe (iommu == dev->of_nodeguaranteesmtp != NULL). - Attribution (§4): Commit
6f0ce9838d5bcarries human Author/Committer and full-name humanSigned-off-by: Ryan Murray <[email protected]>only (zero AI commit trailers); PR body discloses assistance and credits Michal S. - Live CI (§6): All 7 applicable checks (
source,rust-build,kunit,DWC3/ATC builtin-no-atc,DWC3/ATC modular-no-atc,DWC3/ATC builtin-modular-atc,host-tests) completed SUCCESS on6f0ce9838d5b.
Blockers Before APPROVE
- §5 Missing exact-head hardware verification of the modified live-handoff path & regression triad:
- The only hardware test posted is a combined multi-PR test kernel (
7.3.0-aurora-swl1on older base0abc2f38) on a J616s with no live MTP handoff in the DT — so neither the rewritten DARTof_find_compatible_node()/iommuslookup nor thertkit-helperapple_rtkit_helper_retained_mtp()/preservedpath has been executed on hardware on any board (not even onJ614s, where this code is already live today!). The J616s note also omits the §5 regression triad (0 SELinux denials, 0 failed units, 0 new kernel errors). - Please post an exact-head default-cmdline boot on J614s confirming
"Retaining the live MTP bypass","adopted the running RTKit session", working keyboard/trackpad + s2idle, and the §5 regression triad — plus a clean exact-head no-handoff T6040/T6041 regression row.
- The only hardware test posted is a combined multi-PR test kernel (
- Inaccurate PR body, test plan, and commit-message claim about
u-boot#55:- The PR body states "U-Boot#55 will do that on every T6040/T6041 board" and lists a J616s
u-boot#55test row expecting"Retaining the live MTP bypass", and the commit message states "the boot loader picks the retained form by the MTP compatible alone (apple,t8132-mtp or apple,t6041-mtp)". As noted in your Nov 22 comment,u-boot#55(59d31da2) still limits theapple,t6041-mtplive handoff toapple,j614s. Please update the PR description/test plan (and clarify the commit message if amended) to accurately reflect the current U-Boot state and §1 ordering.
- The PR body states "U-Boot#55 will do that on every T6040/T6041 board" and lists a J616s
Non-Blocking Note
- In
drivers/iommu/apple-dart.c,of_find_compatible_node()matchesstatus = "disabled"nodes too (unlikeapple_dart_has_live_rtkit_client()at line 5360, which checksof_device_is_available()). Checkingof_device_is_available(mtp)(or sharing the generic client-walk pattern) would harden against a disabled MTP node on desktop T6040/T6041 boards (J773s/J575c).
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 6f0ce9838d5b: the code is ready; it needs only a row at this head.
Blockers: none in the code. Missing row: the only run is a J616s with no live MTP handoff in the DT, so the rewritten paths (DART lookup by compatible, apple_rtkit_helper_retained_mtp()) haven't run. Needed: one boot at this head on a J614s, where the live handoff exists today, with Retaining the live MTP bypass and adopted the running RTKit session, and the keyboard and trackpad working across s2idle.
Checked: no Apple material. This removes a board gate: the MTP is adopted by its compatible. The J616s no-handoff boot shows the old path unchanged. CI green. This replaces my earlier review: the body's claim about u-boot#55 is a wording fix, not a blocker.
Evidence
Read 6f0ce983 (rtkit-helper.c, apple-dart.c) and the 11-20 J616s note.
Superseded by the review at 6f0ce98
|
|
Problem
The retained live MTP handoff on T6040/T6041 was taken only on the J614s.
drivers/soc/apple/rtkit-helper.c(inventory rule at :200,preservedat :294,strict_buffersat :344 on 0abc2f3) checkedof_machine_is_compatible("apple,j614s")next toapple,t6041-mtp.drivers/iommu/apple-dart.c(:5881) kept the MTP DART in bypass only forapple,j614s, a fixed MMIO address and a fixed node path. Both came from 49d9477 ("soc: apple: retain the live J614s MTP handoff").The MTP firmware cannot be restarted once it has run. On any other T6040/T6041 board that receives a live handoff, Linux would reset the DART under a running firmware and treat the session as restartable.
Change
apple_rtkit_helper_retained_mtp(), keys the retained form on the MTP compatible (apple,t8132-mtporapple,t6041-mtp). The inventory requirement,strict_buffersandpreservedfollow it. U-Boot uses the same compatibles to choose the retained form (arm: apple: choose the MTP handoff in one place u-boot#55,apple_rtkit_helper_retained()).apple,t6041-dartthat theapple,t6041-mtpnode'siommuspoints to keeps its bypass for an advertisedmtp-live-v1session, and refuses an invalid one. The board, address and path checks are gone.Every T6040 and T6041 board has the same MTP node (
t604x.dtsi,mtp@514600000,apple,t6041-mtp), so they all get one rule. No other SoC usesapple,t6041-mtporapple,t6041-dart.If the device tree carries no handoff, nothing changes. J616s, J614c, J616c, J773s and J575c cold-start the MTP as they do today. The change only takes effect when the boot loader publishes
apple,rtkit-handoff. U-Boot#55 will do that on every T6040/T6041 board.The J614s handoff was written by Michal S.
Testing
Build, release config, LLVM:
make W=1 drivers/soc/apple/rtkit-helper.o drivers/iommu/apple-dart.oandmake drivers/soc/apple/. No new warnings.Hardware (one-shot test kernel 7.3.0-aurora-swl1 = integration 0abc2f3 + this and the other open sweep PRs, 2026-11-20):
Still to run
dmesg | grep -E "adopted the running RTKit|live MTP"prints nothing. Keyboard and trackpad work.dmesg | grep -E "Retaining the live MTP bypass|adopted the running RTKit session"shows both lines. There is no "Refusing invalid live MTP DART handoff". Keyboard and trackpad work.apple,t6041-mtp). A boot with a working keyboard is enough.Reach and safety
The checks that refuse a bad handoff (unknown handoff string, CPU not running, DART not in bypass, DART locked or tunneled, no inventory) now apply on every board. Before, they ran on the J614s only.
The T8132
preservedcheck still usesapple_t8132_live_mtp(). That is outside this change.