Skip to content

soc: apple: retain the live J613 MTP through s2idle - #972

Merged
DjDeveloperr merged 15 commits into
integration/aurorafrom
satchlj/port-343-20261104
Nov 11, 2026
Merged

DjDeveloperr merged 15 commits into
integration/aurorafrom
satchlj/port-343-20261104

Conversation

@satchlj

@satchlj satchlj commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Stacked on #971 (port of omacom/linux-aurora#328); review that first.

Retain the inherited J613 MTP firmware, DART bypass and represented power suppliers through s2idle. Check ASC RUN and bypass before and after sleep, reject deeper sleep, and preserve other adopted helpers’ hibernation refusal.

Port of omacom/linux-aurora#343. Depends on the port of omacom/linux-aurora#328; use the stack base above to review this layer. The original PR remains untouched.

Validation: arm64 defconfig + asahi.config, Image/modules/DTBs with BTF and KUnit enabled, LLVM 18/Rust 1.85.0, passed at stack top #343 (11d802aa9a17), which includes this branch. The validated integration base is b500668. QEMU loaded the test-bearing modules successfully with no additional failures. The combined run retains four pre-existing SEP store failures (plus their suite aggregate), reproduced on the unmodified Aurora base. The unmodified pinned base also crashes in apple-av-audio-lifetime/av_lifetime_devres_order; that unrelated audio suite is explicitly excluded. All tests added by these ports run through KUnit debugfs on Cortex-A76. This is not a fully green or complete-tree KUnit run. The production MTP s2idle fixture passed normally and with optimized Python. No 7.3 hardware boot or deployment has been performed.

Keep the boot loader DMA context for a running J613 MTP session. Admit
only the T8122 MTP DART at 0x2fa808000, exactly stream 1, and verify
that its control register still selects bypass before skipping reset.

Select an identity domain and reject paging, blocked-domain attachment
and runtime suspend while the inherited session runs. Retain the clock
and bypass state at removal. This permits the existing mtp-live-v1 RTKit
adoption path to keep serving input without another INIT.

The C-diag11 implementation passed owner input testing on J613 with
firmware 26.6.2. The rebased series requires a separate owner boot test.

Signed-off-by: Satya Benson <satya@benson.earth>
The J613 and J615 25G83 device trees list the MTP as "apple,t8122-mtp",
"apple,t8122-rtk-helper-asc4", "apple,mtp" without the generic
"apple,rtk-helper-asc4" fallback, and say that Linux binds the
SoC-specific compatible. The helper only matches the generic one, so on
those boards it never probes, DockChannel HID defers forever and the
built-in keyboard and trackpad stay absent.

Match "apple,t8122-rtk-helper-asc4" as well.

Signed-off-by: Satya Benson <satya@benson.earth>
Keep the adopted MTP firmware session and identity DMA stream powered through s2idle. Check ASC RUN and bypass before and after sleep, reject deeper sleep, and refuse to reset inherited DMA on loss. Leave non-J613 helpers and ordinary DART runtime PM unchanged.

Exercise the real PM callbacks with host fixtures, including abort unwinding and non-J613 peers. Keep successful retention messages at debug level.

Signed-off-by: Satya Benson <satya@benson.earth>
Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@DjDeveloperr @RyanTheTide ready for your regression testing. It hasn't been boot-tested on J613 with 7.3 yet; I'll post the result here when I have it.

Conflict in drivers/iommu/apple-dart.c, apple_dart_probe(): integration
added the v2.2 reg size check (d6b6f2e, #924) right after the
stream count check, where this branch adds the J613 live MTP bypass
check. Keep both. The size check comes first: it only needs num_streams
and validates the MMIO region before the J613 check reads a stream
control register. Both checks fail the probe, so the order only decides
which error a bad node reports.

The J613 MTP DART node has a 0x4000 reg. T8122 DARTs report a version
below 2.2: the other T8122 DARTs have the same reg size and are reset on
J613 by kernels whose reset path reads the v2.2 exception records at
0x8000, without faulting. The size check therefore does not refuse the
J613 MTP DART.
Bring in the parent branch after its merge of integration/aurora.

Conflict in tools/asahi/run-host-tests.py, ASAHI_TESTS: integration
registered ane-tm-transient-fault-tests.py at the top of the table,
where this branch registers j613-mtp-s2idle-tests.py. Keep both
entries unchanged.
dchid_send() writes a frame as up to four dockchannel_send() calls:
header, body, tail word and checksum. Only the interface's out_mutex
serializes it, so frames for two interfaces can interleave in the shared
TX FIFO.

On J613 (M3 MacBook Air, T8122, 26.6.2 firmware) this crashes the MTP
firmware, and the internal keyboard and trackpad stay dead until reboot.
The firmware's crash log reads

  RTKit: Message (id=1): [dock ch tl]: xsum err [comp=0xfff2ec9d; rcvd=0xc1108]

rcvd holds the bytes 08 11 0c 00: the header of a 12-byte command frame,
an interface enable, where another frame's checksum belonged. In the
three crashed boots, the actuator enable (0xb4 on comm) and magicmouse's
dimension query (0xd9 on multi-touch, sent when multi-touch reports
ready) both timed out at the same moment.

Hold a transport-wide mutex across the writes of one frame. dchid_send()
is the only path that writes to the FIFO. The lock order is the
interface's out_mutex, then tx_mutex.

The host test sends frames from two interfaces in two threads through the
production dchid_send() and parses the FIFO with dchid_verify_checksum();
the driver before this change fails it.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

J613 boot result on 7.3 (rubra, M3 MacBook Air 13", macOS 26.6.2 / 25G83 firmware), 2026-11-05.

Keep only the transport-wide MTP TX frame lock and registered tests over the merged J613 handoff fix. Preserve zero-stream/J700 admission and newer DART PM handling.

Signed-off-by: DjDeveloperr <43033058+DjDeveloperr@users.noreply.github.com>
Retain only the distinct live-MTP system sleep transaction over current handoff and frame serialization. Keep runtime suspend refused, verify bypass/ASC RUN across s2idle, and preserve the existing helper PM registration.

Signed-off-by: DjDeveloperr <43033058+DjDeveloperr@users.noreply.github.com>
@DjDeveloperr
DjDeveloperr changed the base branch from satchlj/port-328-20261104 to integration/aurora November 11, 2026 14:46

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

Integrated current #971 and stacked the distinct PM retention change on the rebased #1010. Both now target integration/aurora; latest zero/absent-stream behavior and newer DART display/retained-DMA logic are preserved. The stale duplicate RTKit-helper PM initializer was omitted; the existing registration remains. Incremental source scope, diff checks and existing production PM harness passed in normal/optimized ASan/UBSan runs. I dispatched broad host CI once because retarget alone did not trigger it. Merge order is #1010 then #972. Hardware gate remains: actual RTC-woken J613 s2idle with physical input/haptics and retained ASC RUN/bypass, plus deliberate deeper-sleep/hibernation refusal. The earlier real-sleep composition using #971 is not proof of this distinct implementation.

@satchlj

satchlj commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

GPT-6.1 Sol on @satchlj's behalf

Exact PR head tested: 14a92d9bb12ca680331f71f9409d3e4176fb00ae.

Unattended J613/T8122, firmware 26.6.2. Kernel 7.3.0-aurora73-exact-1111-ARCH, integration 716670b987b23536eafea3b647ffa7f28ef762b7, composed tree 065ddae82b1a176c46f75fe537b6e918b84f69ea; UKI SHA256 4320b9c09b7b1a394273c0090bdf77d93a6a7bb86ee297682f68edf0ba2878e5. Combined with #1486/#972/#973/#974/#1560/#1559/#1010; #1561 is already in integration, #1490 excluded because the installed Stage 2 lacks its required CIO CPU resource. This is combined-tree evidence, not an isolated-PR kernel. Installed Stage 2 was unchanged.

Three requested 60s RTC s2idle cycles completed on this exact tree. Durable kernel journal entry→exit intervals were 61.638168s, 60.972506s and 60.906417s. RTC IRQ 93 counted four wakes in total (the prior floor suspend plus these three), and the last wake IRQ was 93. No MTP/dockchannel/checksum error appeared in the full wake journal.

Input checks: the first two post-wake evdev/IRQ/error assertions necessarily completed before the script entered the next cycle. After the third, a separate saved inventory confirmed the keyboard and multi-touch /dev/input nodes and capability masks were present. No person typed or touched the trackpad.

Receipt limitation: the original SSH stream returned 255 (Read from remote host ... Operation timed out / broken pipe), losing per-round JSON stdout while the back-to-back cycle loop continued. A separate probe also timed out during the third sleep. I waited over five minutes before retrying SSH; it returned on the same trial. The durable journal proves all three entry/exit pairs; no reset, recovery operation or repeated RTC attempt was needed. This was not a persistent kernel hang. The transport failure is retained, and its root cause is not established here.

Not run: physical typing/trackpad interaction, deeper sleep, or broader suspend stress. Left on default 30.12, trial cleaned and lease released.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

The three journal-backed RTC s2idle cycles in comment6804319780 close the earlier absence of real sleep evidence for the exact14a92d9 source included in that combined J613 trial. The lost SSH stdout does not require repeating the cycles merely to recover per-round JSON. Physical input/haptics and broader stress remain unqualified, but are not automatically blockers to this narrow PM change.

One retained-evidence gap remains. In this source the helper’s ASC RUN checks execute only when helper->adopted is true, and DART bypass retention checks execute only for the admitted live_mtp stream-1 handoff. Other paths return or delegate without those checks, so successful sleep and evdev registration alone do not establish that this specific retention path ran.

From the records already saved for that completed trial, please confirm that the J613 MTP helper was adopted and the matched J613/T8122 DART stream-1 live handoff was admitted. Redacted booleans or a retained boot/live-DT/callback summary are enough. This requests existing facts only, with no new commands, machine access, sleep test, recruitment, MMIO dump or media. With activation established, the completed cycles and absence of the explicit lost-RUN/bypass diagnostics provide meaningful pre/post guard coverage.

The deeper/hibernation helper refusal is inherited unchanged, and the retained production DART harness exercises non-s2idle refusal; I am not requiring a new forbidden-state hardware attempt. No new source defect was found by the independent reassessment.

#1010 has now merged as727f6fc8 after all four current checks passed. #972’s three SEP checks pass, but its separately dispatched host check failed dependency setup; one initial targeted host retry is accepted. Merge remains pending that actual host result and the retained activation facts above.

@satchlj

satchlj commented Nov 11, 2026 •

Copy link
Copy Markdown
Member Author

Claude Fable 5.2 on @satchlj's behalf

@DjDeveloperr the two activation facts, from records, with one stated exception.

MTP helper adopted: yes. The kernel logs retained at four points of that run of 7.3.0-aurora73-exact-1111-ARCH (first boot, the floor-off boot, the floor-on boot and the final health capture) each contain the line below. I have not matched each file to a boot ID, so I am not claiming which of them is the boot the three RTC cycles ran in; every retained kernel log of the trial has it and none lacks it.

rtkit-helper 2fa400000.mtp: adopted the running RTKit session (4 retained buffers)

DART stream-1 live handoff admitted: yes, but not from a record saved during the trial. The driver logs nothing when admission succeeds, and the trial did not save the live device tree, so the retained files cannot show it directly. What establishes it:

  • A read-only look just now at the same machine, running the same UKI (7.3.0-aurora73-exact-1111-ARCH, booted again for an attended display session) through the same unchanged installed Stage 2: /proc/device-tree/soc/iommu@2fa808000/apple,bypass-handoff-streams is <1>, the node's compatible is apple,t8122-dart, apple,t8110-dart, and 2fa808000.iommu is bound to apple-dart. The helper adoption line is present in this boot too.
  • At this head the probe returns -EINVAL if that property is present with a non-zero stream and any admission condition fails (machine, compatible, address, bypass support, stream 1, stream-1 TCR equal to bypass), so a bound DART with the property at 1 means live_mtp was set. The property is written by the installed Stage 2, which was the same image (unchanged hash) for the trial.

This is a different boot of the same kernel and boot chain, not the trial boot itself; no sleep test or other action was run for it.

Guard diagnostics in the trial: the retained wake journal for the three cycles has no "bypass lost", lost-RUN or refusal line (zero matches for lost or bypass).

The host check that failed in dependency setup is already re-running (run 43042158895); I did not start another.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

The remaining narrow retention gate is now addressed by the author’s activation reply6804812643, the three journal-backed RTC s2idle cycles and current host/source/Rust/KUnit passes. #1010 is already merged. Source approval is given on unchanged14a92d9 after an independent final evidence assessment.

Retained trial logs directly show adopted MTP RTKit sessions. The later read-only boot is explicitly a different boot, but uses the same reported exact UKI and unchanged installed Stage2. On this source, a bound matched J613 DART with bypass-handoff-streams=<1> necessarily admitted live_mtp: a nonzero invalid handoff fails probe, and no runtime switch clears that admission. Carrying this fact back to the documented trial is a reasonable inference from the unchanged producer/kernel plus the trial adoption logs, not direct saved-trial live-DT evidence. The files were not individually matched to boot IDs; that limit remains explicit. No new sleep run or raw MMIO capture is required merely to replace unavailable old records.

Three approximately61s RTC-woken s2idle entry/exit pairs and no lost-RUN/bypass/refusal diagnostics meaningfully exercise the retained path within that combined J613 trial. Physical typing/trackpad/haptics, deep sleep, sleep power and broader stress remain unqualified. The inherited deeper-state/hibernation refusal remains supported by source comparison and the retained production DART harness, without claiming a new forbidden-state hardware attempt.

Current-main three-way comparison is clean: all three modified DART/helper/runner paths in main match the actual merge base, and the resulting source is byte-identical to this reviewed head. The initial mergeability false was transient, so no rebase or rebuild was needed. No new machine access, hardware test, recording, loader/default write, source change or image operation was performed.

@DjDeveloperr
DjDeveloperr merged commit 33a1208 into integration/aurora Nov 11, 2026
5 of 8 checks passed
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.

2 participants