Repository navigation
arm: apple: hand an MTP over running when its device tree says its firmware cannot be restarted - #67
Conversation
|
Claude Opus 5.5 on @satchlj's behalf. Hardware result on MacBook Air M2 (J413, T8112), macOS 27.2 (26B123) stub: pass. The change is now part of phellos's default. Tested in phellos's upstream-first build, and it is now the default (one-shot
🤖 Generated with Claude Code |
|
Thanks for this, and for finding the two-stage power command the trackpad needs. The reason given, that this MTP firmware cannot be restarted once it is quiesced, also applies to the J613, J713 and T8140, which already hand the MTP over running through their own checks. This adds a third, chip-specific one:
We'd prefer one policy for every MTP SoC: hand the MTP over running wherever the helper's DART can stay in bypass and the OS can adopt the session, chosen from the device tree, not by SoC or board. The If you go that way, we can run rows on our M2 (T8112), M1 Pro, M4 Pro and A18 Pro. |
|
Claude Opus 5.5 on @satchlj's behalf. Thanks. Reworked in a new commit,
What I did not merge: J713/J614s ( Hardware, J413 / 27.2 stub, one-shot Stage 2 (
Not tested: GRUB keyboard input (it needs a person), J613 with the property in place of its board check, J415/J493. Merge order: linux#2525's DT commit before this, or J613 loses its handoff. Your M2, M1 Pro, M4 Pro and A18 Pro rows would be very welcome. |
|
Thanks for b9efd22. One Leaving the J713/J614s and T8140 publication paths separate in this PR is fine. Moving their "hand over running" decision onto the same property can be a follow-up. We will run rows on our M2, M1 Pro, M4 Pro and A18 Pro on this head with the linux#2525 DTBs. |
|
Claude Opus 5.5 on @satchlj's behalf: hardware run.
Build: phellos (MacBook Air M2, J413, macOS 27.2 / 26B123 stub), default rebuilt 2026-11-20 = linux |
|
J615 row (15-inch MacBook Air M3, T8122), 27.2 stub, this PR at b9efd22 built unmodified ( Stage 1 aura tip-dev; one-shot Stage 2 = aura 1.0.0b13.1 (or 1.0.0b13.1 with the 27.2 DCP picks) + a J615 DTB with
Merge order as noted: linux#2525's DT (the J613 property) has to land with or before this, or the J613 loses its handover. The J615 DT lines go in a follow-up stacked on linux#2525. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
The code is good, and it does what Ryan asked for in the earlier round. One apple,rtkit-keep-running property on the helper node feeds the existing retained-epoch path, and the T8112 firmware-version check is gone. I'm requesting changes only for the DCO: b82f77d, 6126117 and b9efd22 have no Signed-off-by: line. Please re-sign them (git rebase --signoff aurora-wip) and push. I'll merge this right after linux#2525.
- Contract: the property's name, type and node match linux#2525's binding and the J613, J413-fw27 and J615 device trees. Both
apple_rtkit_helper_keeps_running()(helper node) andapple_mtp_kbd.c:524(priv->helper, set byget_rtkit_helper()before that line) read the same node. - Boards without the property behave as on
aurora-wip, except the J613, which now needs the property from its DTB. On a J613 with an older DTB,board.c:1713still starts the MTP for the U-Boot keyboard. U-Boot then quiesces it, which is the crash case. So a release has to pair this U-Boot with DTBs built from linux after #2525. - Failure handling: the publication panic (
rtkit_helper.c:679) and the DART-retention panic (:347) now cover every board with the property, as they already did for the J613. Stopping in U-Boot is better than booting with an MTP that was promised but is dead.
CI on b9efd22: Apple builds build is green, and draft was skipped as expected.
The MTP firmware that the macOS 27.2 stub loads on T8112 (MacBook Air M2, J413) cannot be restarted once it has been quiesced. Unlike the 13.x firmware on the same SoC, Linux's cold start of it then fails. It needs the J613 path: U-Boot keeps the first epoch running, with OSLog in SRAM, publishes the four-endpoint inventory (mtp-live-v1), and announces and replays discovery to the OS. Select that path with apple_t8112_mtp_live_epoch(): an apple,t8112-mtp node, plus an OS firmware of 27 or later in /chosen/asahi,os-fw-version. No board name is matched. The 13.x firmware keeps the existing restart path. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Satya Benson <[email protected]>
With the 27.x MTP handed over running, Linux's trackpad still timed out
("iface multi-touch start timed out"): this firmware answers only the
two-stage power command that apple,power-method = <2> selects, as on
J613/25G83 and T8132. Set it on the multi-touch node of the OS device
tree when apple_t8112_mtp_live_epoch() holds and the tree sets none.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Satya Benson <[email protected]>
Instead of a T8112 + OS firmware >= 27 check and the J613 board check, the retained-epoch handoff (OSLog in SRAM, buffer inventory, DART kept in bypass) is chosen by apple,rtkit-keep-running on the MTP helper node, which the board device tree sets where the firmware cannot be restarted once quiesced. The same property starts U-Boot's MTP keyboard on the EFI path and makes the keyboard preserve the startup frames for Linux. The trackpad's two-stage power command is no longer patched into the OS device tree here; the board device tree describes it (apple,power-method), as J613/25G83 already does. apple_rtkit_helper_keeps_running() and _any_keeps_running() have inline stubs without CONFIG_APPLE_MTP_KEYB, which fixes the apple_j873 link. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Satya Benson <[email protected]>
b9efd22 to
6f50fc2
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks for the sign-offs. All 3 commits now carry Signed-off-by, and the tree is byte-identical to the head I reviewed (18789d02), so I'm approving.
This merges right after linux#2525, so the U-Boot never ships ahead of the DTBs that carry apple,rtkit-keep-running. linux#2525 is waiting on a dt-checks false positive that has nothing to do with its code.
Claude Opus 5.5 on @satchlj's behalf.
arm: apple: hand an MTP over running wherever its device tree says its firmware cannot be restarted, instead of matching a board or SoC.Why: some MTP firmware cannot be restarted once quiesced, so U-Boot has to hand its first epoch to the OS running: J613, and T8112 (MacBook Air M2, J413) on the macOS 27.2 stub. On J413 a quiesced 27.2 MTP leaves Linux's trackpad answering "Received unknown power state (1)" and timing out.
Selection:
apple,rtkit-keep-runningon the MTP helper node, set by the board device tree (aurora-silicon/linux#2525 adds the binding, sets it int8122-j613.dts, and addst8112-j413-fw27.dts). That one property replaces U-Boot's J613 board check, the earlier T8112-plus-firmware-27 check, and the J613 entries in the keyboard's discovery-replay check. It selects the existing retained-epoch path,rtkit_helper_fdt_publish()with the buffer inventory. The DART must still keep its bypass, and the session must still publish. J713/J614s and T8140 keep their own handoffs (a different publication, and the opt-in DRAM path).Trackpad power: the two-stage power command (
apple,power-method = <2>) is no longer patched into the OS DT by U-Boot. The board DT carries it, ast8122-j613-25g83.dtsalready does.CI:
apple_rtkit_helper_keeps_running()andapple_rtkit_helper_any_keeps_running()have inline stubs withoutCONFIG_APPLE_MTP_KEYB, soapple_j873links again.Merge order: J613 now needs the property in its DT. Merge linux#2525's DT commit first, or J613 loses its handoff.
Testing
apple_m1_defconfigandapple_j873_defconfigbuild and link.t8112-j413-fw27.dtb. That DTB is the defaultt8112-j413.dtbplus exactly the two properties. Result: pass. Details are in the comment below.🤖 Generated with Claude Code