Skip to content

arm: apple: hand every unparked MTP over live, the same way - #57

Draft
RyanTheTide wants to merge 1 commit into
sweep/mtp-one-handoff-policyfrom
sweep/mtp-live-fallback-everywhere
Draft

RyanTheTide wants to merge 1 commit into
sweep/mtp-one-handoff-policyfrom
sweep/mtp-live-fallback-everywhere

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #55. The base is sweep/mtp-one-handoff-policy, so this diff holds only the behaviour change. Draft until the hardware rows below are run.

#55 picks the MTP handoff in one place. For an MTP that is not parked, it still keeps each board's current path from a qualification table. This PR removes that table and makes the live handoff the one fallback for every MTP that cannot be restarted. Parking stays the intended path (/chosen/aurora,mtp-handoff = "off", #49): this PR only changes what happens when the MTP is not parked.

Changes

  • With no park, every non-restartable MTP gets the live handoff:

    Boards Before After
    J604, J715 (T8132) cold retained live handoff
    J616s, J614c/J616c (T6041) cold retained live handoff
    Other M3 boards (T8122, T6030/1/4) started, then QUIESCED (that firmware does not survive the restart) live handoff
  • One live publication form everywhere. The buffer inventory is always published (T8140 had none), and nothing is published before the keyboard's READY (before, only J613 waited).

  • The DART bypass is checked at probe, before the firmware is started, on every live MTP. Before, only T6041 checked it there.

  • A published session whose DART retention fails refuses OS entry. Before, T8140 stopped the firmware it had just promised to the OS.

  • A failed publication stops the MTP and disables it and its keyboard in the OS tree. Before, T8140 left the nodes in place.

Tests

  • apple_m1_defconfig, GCC 16.1 aarch64, KCFLAGS=-Werror: builds clean.
  • test/py/tests/test_apple_*.py with --noconftest: 36 passed, 2 skipped. The policy rows are updated: J604/J715/J616s/J616c are retained live, and J504/J514c are live. The live publication test now always expects the inventory and READY, with and without DRAM buffers. The remove test now expects every published session to fail closed.

Hardware rows owed

One-shot U-Boot boots, each checking the keyboard at the U-Boot prompt and in GRUB, then Linux "adopted the running RTKit session" and a working keyboard and trackpad:

  • Neo J700: inventory plus READY. This needs a kernel whose rtkit-helper accepts an inventory on T8140 (strict_buffers).
  • J616s: cold to retained live. This needs a kernel change first: in drivers/soc/apple/rtkit-helper.c, the of_machine_is_compatible("apple,j614s") checks next to apple,t6041-mtp (in inherit_buffers, preserved and strict_buffers) must become compatible-only, like the T8132 ones.
  • Community boards: J604 (aeries0x offered in input: apple_mtp_kbd: leave the J604's MTP to Linux #44), J715, J614c/J616c, an M3 board, and J613/J713/J614s as regression checks.

Without a park, the live handoff is the only path that keeps both the
U-Boot keyboard and a working MTP in the OS on firmware that cannot be
restarted. It is qualified on the J700, J613, J713 and J614s. Drop the
per-board fallback table so every such MTP gets it: the J604, J715,
J616s and J614c/J616c move from a cold MTP, and the remaining M3 boards
from the restart path that firmware does not survive.

Publish the live session the same way everywhere: always with the
buffer inventory, and only once the keyboard is ready. Check the DART
bypass at probe, before starting a firmware the OS could not start
again. Refuse OS entry when a published session's DART retention fails.
On a failed publication, stop the MTP and disable it and its keyboard in
the OS tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 3.

  1. This no longer applies. aurora-wip now has arm: apple: hand an MTP over running when its device tree says its firmware cannot be restarted #67 (11bf692), which picks the running handoff from the board DT: apple,rtkit-keep-running on the MTP helper node (apple_rtkit_helper_keeps_running(), rtkit_helper.c:65-88 on aurora-wip). arm: apple: hand an MTP over running when its device tree says its firmware cannot be restarted #67 already took out the J613 board check and the T8112-plus-firmware-27 check this PR's table stood in for. arm: apple: choose the MTP handoff in one place #55, this PR's base, now conflicts with aurora-wip. Here, apple_rtkit_helper_handoff() returns APPLE_RTKIT_HELPER_LIVE for every unparked MTP (rtkit_helper.c:109) and never reads that property, so the two selection models would fight.
    Fix: rebase onto arm: apple: hand an MTP over running when its device tree says its firmware cannot be restarted #67. Let the boards that need the running handoff say so with apple,rtkit-keep-running in their DT, and keep this PR to the parts that don't depend on selection: the probe-time DART bypass check (:301-312), the single publication form, and fail-closed on retention error (:386).
  2. The J616s and J616c move from a cold MTP to a retained live session that their kernel does not adopt as retained. drivers/soc/apple/rtkit-helper.c:201, :296 and :345 on integration/aurora match apple,j614s with apple,t6041-mtp to set preserved and strict_buffers. The PR body says the kernel change has to come first. Merging before that kernel ships changes the J616s input path with no kernel to take it. Land the kernel change first, then show the J616s row.
  3. Commit 5d97c6e has no Signed-off-by and carries Co-Authored-By: Claude Opus 5.5. It needs the author's Signed-off-by and no agent trailer.

HW row: on the rebased head with the matching kernel, one-shot U-Boot boots:

  • J700 and J613: keyboard at the U-Boot prompt and in GRUB, then "adopted the running RTKit session", and keyboard and trackpad in Linux, 3x s2idle.
  • J616s: the same, with the kernel change.
  • J713 and J614s: regression boots.

All with 0 AVC, 0 failed units and no new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant