Repository navigation
arm: apple: ignore non-RAM apple,dma-range for bypass RTKit helper allocations - #79
Conversation
…locations rtkit_helper_read_dma_window() reads apple,dma-range from the helper's DART node and rtkit_helper_alloc() uses it as a physical LMB allocation ceiling because U-Boot runs the DART in bypass mode. That works when apple,dma-range overlaps physical RAM (e.g. T8122/T8140 where DRAM starts at 0x10000000000 and the window covers the low 4 GiB), but fails on T8112 (M2 / J413) once Aura propagates /arm-io/dart-mtp's 32-bit translated IOVA window [0x4000, 0xffff4000) into apple,dma-range: DRAM on T8112 starts at 0x800000000, so lmb_alloc_mem() below 0xffff4000 always returns NULL. On macOS 27.2 firmware, rtkit_helper_probe() then aborts after setting REG_CPU_CTRL_RUN, burning the one-shot MTP epoch and leaving Linux without keyboard or trackpad (-ETIME). Only constrain physical bypass allocations to apple,dma-range when the window overlaps [gd->ram_base, gd->ram_top), falling back to normal DRAM allocation otherwise. Add a host unit test covering T8112, T8122/T8140, above-RAM, and overflow ranges. Signed-off-by: Satya Benson <[email protected]>
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
Second-machine row at Chain: Stage 1
Built-in keyboard, multi-touch, Force Click and haptics all come up. No MTP or DART errors in the kernel log. Not covered: s2idle/deep sleep with this stage2. |
There was a problem hiding this comment.
Verdict: MERGE at 944606df after the boot-path merge gate.
Checked: I ran the added host case against the PR source. It passes for disjoint, overlapping and overflowing windows. The overlap check preserves the clamped LMB path when the range intersects DRAM and leaves DART discovery in place. The exact J413 run adopted the live helper where the translated window lies below RAM. The exact J613 run exercises the retained clamp, with the same live handoff and working input.
Keep the guarded Stage 2 receipts and the boot-path approval with the merge. The J613 receipt covers boot and input, with suspend still outstanding.
|
Suspend row at this head on J613 (MacBook Air 13" M3, T8122): 20/20 s2idle cycles with 15 s RTC wakes, and the keyboard and trackpad worked afterwards. Setup: Stage 2 Aura Results:
Scope: s2idle never leaves Linux, so U-Boot is not on the suspend path. This row shows that the handoff from this Stage 2 leaves suspend/resume and the input devices working; Deep sleep, which does come back through the boot object, was covered earlier the same evening on this same Stage 2: 3/3 |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 944606df
Blockers: none.
Checked: apple,dma-range now bounds bypass allocations only when it overlaps [ram_base, ram_top). That leaves T8122, T8132, T8140 and T6041 with the same bounds, and stops T8112's 32-bit translated window, which lies below RAM, from failing every allocation. DART discovery is unchanged, and the overflow check still runs first. The decision comes from the DT and RAM layout, with no chip check. Rows are at this head on J413, where the live MTP handoff is adopted and input works before and after s2idle, and on J613, where the clamp is exercised and 20/20 s2idle cycles keep input. Build and host tests are green.
rtkit_helper_read_dma_window()treats the helper DART'sapple,dma-rangeas a physical DRAM ceiling for bypass-mode allocations (lmb_alloc_mem(LMB_MEM_ALLOC_MAX, ...)).Since
aurora-silicon/aura#519(507cd792) removed the M3 allowlist fromdt_set_mtp_dma_window(), Aura now writes/arm-io/dart-mtp's 32-bit translated IOVA window[0x4000, 0xffff4000)onto T8112'siommu@24e808000. Physical RAM on T8112 starts at0x8_0000_0000, sortkit_helper_alloc()always returnsNULL,rtkit_helper_probe()aborts after starting the MTP ASC (burning the one-shot macOS 27.2 MTP epoch),apple,rtkit-handoffis never published, and Linux fails to wake MTP with-62(-ETIME).Only clamp bypass physical allocations to
apple,dma-rangewhen the range overlaps[gd->ram_base, gd->ram_top), preserving the existing clamping on T8122/T8132/T8140 while falling back to normal DRAM allocation whenapple,dma-rangeis a translated IOVA window disjoint from RAM.Tested:
944606df3f4on MacBook Air M2 (J413): PASS — booted on MacBook Air M2 (J413 / T8112, macOS 27.2 stub26B123) paired with Auramain(76d2f9ae) and Linuxmain(a40c5131071d1):apple,dma-rangepresent oniommu@24e808000,apple,rtkit-handoff = "mtp-live-v1",rtkit-helper 24e400000.mtp: adopted the running RTKit session (4 retained buffers), built-in keyboard, trackpad, Force Click, and haptics working before and after GPU-bound s2idle with 0 MTP/DART errors.test/py/tests/test_apple_helper_handoff.py(all 7 tests including newtest_dma_window_requires_dram_overlap) pass.apple_m1_defconfigandapple_j873_defconfigwithCONFIG_WERROR=y.Risk: two-way · Low. Scoped to
rtkit_helper_read_dma_window(); SoCs whoseapple,dma-rangeoverlaps DRAM (T8122/T8132/T8140/T6041) retain identical allocation bounds.