Repository navigation
iommu/apple-dart: wait out stalled display invalidates on locked DARTs - #3125
Conversation
On the MacBook Air 15" M5 (J815) the internal display's DART logs apple-dart 286300000.iommu: TLB command 0x1 for stream 0 timed out (0x8700e100) when the compositor starts and when the display powers back on, 0 to 32 lines per boot, and kwin's framebuffer import fails at the same instant: kwin_wayland: drmPrimeFDToHandle failed: Invalid argument kwin_wayland: Failed to create framebuffer: Invalid argument That is the J700 stall that 911de8e ("iommu/apple-dart: wait out stalled J700 display invalidates") waits out: a FLUSH_SID by range (V2, RANGE, STT) of the display subsystem's stream 0, still busy after 2 ms. The wait was gated on the reserved firmware table handoff, which J700's loader sets up. J815's loader leaves disp0 locked without the handoff, so the same stall still fails there after 2 ms. What the wait relies on is the DART being one the display subsystem scans out through, and taking range invalidates, which only locked DARTs get. Decide display_scanout from the lock instead of the handoff; every handed-off DART is locked, so J700 keeps the wait. The DCP firmware DARTs, other devices' DARTs and DARTs with sleep lists or a CTC flush still fail after the short wait. The host test's no-handoff case now expects the wait, and the mutation that drops the scan-out check is renamed every-dart. Signed-off-by: Nick <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
J815 (MacBook Air 15" M5) row at Candidate: Two boots ( Regression on the same boot ( |
satchlj
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 4ad71b88134d
Blockers: none
Checked: full diff, hardware verification status, and live CI
Evidence
- Previously audited diff at
4ad71b88134dis clean with no regressions or unresolved review blockers. - Live CI is now 100% green (19/19 checks passed, 0 pending, 0 failed) with exact-head hardware verification recorded on the PR.
|
|
|
Merged into main (ORCH5 batch, 11-26). Thanks @m0d16l14n1! The exact-head hardware row it landed on is #3125 (comment). Assisted-by: LLM (Claude:Opus 5.5) |
What: the display DART's stalled-invalidate wait (911de8e, for J700) now applies to every locked display DART, not only to ones with the firmware table handoff. The J815's display DART is locked without the handoff, so its range invalidates still failed after 2 ms, and kwin's framebuffer import failed at the same instant.
Tested: J815 (MacBook Air 15" M5) at
4ad71b88134d: 0TLB command ... timed out, 0 kwin framebuffer failures on both test boots at this head and on one more with the same patch (before: 2 to 32 timeouts and 1 to 13 failed imports per boot). Host testapple-dart-tlb-stall-tests.pyPASS, and currentmainfails its new no-handoff case. Regression at boot: 0 SELinux denials (SELinux off), 0 failed units, 0 new kernel errors from this change.Risk: two-way door. Locked display DARTs on every Mac. Handed-off DARTs are always locked, so J700 keeps the same wait; unlocked DARTs and other devices' DARTs are unchanged.
Not yet: none of these boots stalled, so the wait itself has not run on the J815 yet (0 "stayed busy" lines). Rows on J700 and J813 at this head.
Details
The J815 logs, when the compositor starts and when the display powers back on:
0x8700e100is busy plus a FLUSH_SID by range (V2, RANGE, STT) on the display subsystem's stream 0: the same stall J700 shows, which 911de8e waits out. That wait was gated ondart->fw_handoff(apple,firmware-root-handoff). The J815's loader leavesdisp0locked without that handoff, so the 2 ms timeout still failed there.The wait only needs the DART to be one the display scans out through and to take range invalidates, which only locked DARTs get.
display_scanoutis now decided from the lock. The DCP firmware DARTs, other devices' DARTs, and DARTs with sleep lists or a CTC flush keep the short timeout.tools/asahi/apple-dart-tlb-stall-tests.py: the no-handoff case now expects the wait (it waits out 40 ms). The mutation that drops the scan-out check is renamedevery-dartand is still killed.Evidence
J815, macOS 27.2 stub, command line default plus
pcie_aspm=offand three sleep opt-ins that don't touch the DART.maina977440 + the J815 PRsmain2943fff + the J815 PRsHost test:
tools/asahi/run-host-tests.py(apple-dart-tlb-stall-tests.py --dtc) PASS; the old revision and theevery-dartmutation are killed.