Skip to content

iommu/apple-dart: fail closed when an unmap's TLB retirement fails - #3310

Open
DjDeveloperr wants to merge 6 commits into
mainfrom
fix/apple-dart-unmap-sync-fail-closed
Open

DjDeveloperr wants to merge 6 commits into
mainfrom
fix/apple-dart-unmap-sync-fail-closed

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: A strict DART unmap (iotlb_sync), or a flush-queue domain's full flush, whose TLB retirement fails no longer returns as if it worked. Before, the IOVA and pages could be reused while a DART still translated them. Now the domain's streams on the failing DART are stopped (TCR disabled and read back), or, when that can't be shown, the kernel panics as the T6050 live-unmap path already does. The domain then refuses new mappings. The Apple DART KUnit suite also runs in CI now.
Tested: no hardware row yet at ef9eb65 (merged with main 2094ccb). On arm64 QEMU with 16 KiB pages and APPLE_DART_J713_DCP=y the apple-dart KUnit suite runs 48/48. With the 4 KiB kunitconfig it runs 39: 37 pass and 2 are skipped because they need 16 KiB pages. The 7 new fault-injection cases pass, and 6 of them fail with the old discard behaviour. apple-dart.o builds W=1-clean with defconfig + asahi.config (J713_DCP=y). The DART host tests (16/16) and bcm4377-radio-sids pass.
Risk: two-way door · all Macs (shared apple-dart code). A flush failure that used to be logged and ignored now stops that device's DMA, or panics if the DART can't be reached or doesn't take the stop. Normal unmaps, gated commands during sleep and DCP-borrowed domains are unchanged.
Not yet: hardware rows on at least two generations; the checklist is under Testing.

Details

Problem. apple_dart_domain_flush_tlb_range() collects errors from four places:

  • runtime-PM resume;
  • locked page-table publication (apple_dart_hw_sync_locked());
  • firmware-coordinated range invalidation;
  • the hardware TLB command.

It returns the first one, but apple_dart_iotlb_sync() and apple_dart_flush_iotlb_all() discarded it. dma-iommu frees the IOVA right after iommu_iotlb_sync(), and the caller then frees or reuses the pages. A DART that failed to retire the mapping could still translate to them. Only managed streams were quarantined, and only on an invalidate failure. The driver's own comment on apple_dart_t8110_tlb_wait() already names this hazard, and the T6050 display-sleep unmap already panics on it.

Change (struct apple_dart_retire, filled in by the flush when its caller frees what was unmapped):

  • Live failure: a DART that failed while the flush powered it, with its commands not gated, has the domain's streams disabled (apple_dart_retire_fence()). Each TCR must then read back tcr_disabled. A disabled stream reaches no memory, whatever its TLB or tables hold.
  • Stuck: a DART that runtime PM couldn't resume, or that is dark or closed for its owner's power cycle while a locked root couldn't be published, can't be touched or shown stopped. The same goes for one whose TCRs don't take the disable. apple_dart_retire_stuck() then panics, rather than letting the pages be handed out again.
  • Latch: apple_dart_retire_check() sets domain->retire_failed, and apple_dart_map_pages_unguarded() then returns -EIO until the domain is freed.
  • Where it applies: iotlb_sync (strict unmaps), and flush_iotlb_all only for IOMMU_DOMAIN_DMA_FQ domains, where it retires the queued unmaps. In strict domains a full flush retires nothing, so a failure there is logged as before.
  • Not failures:
    • -EHOSTDOWN (gated commands): the DART's sleep list stopped every stream and flushed its TLB before gating, and nothing translates until a restore.
    • Borrowed DCP domains keep their own failure handling.
    • iotlb_sync_map and the T6050 live unmap are unchanged.

CI. No check ran the apple-dart KUnit suite before. This adds drivers/iommu/apple-dart.kunitconfig to the KUnit matrix.

Evidence

kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/iommu/apple-dart.kunitconfig at ef9eb65: 37 run, 36 passed, 1 skipped (apple_dart_test_independent_remap_roots needs 16 KiB kernel pages). No lockdep, BUG or WARNING lines.

Injected failure With the fix Discarded as before
hardware TLB invalidate times out (apple_dart_test_retire_tlb_timeout) streams 0-1 stopped, map -EIO FAIL
firmware invalidate fails (_fw_invalidate) streams stopped, map -EIO FAIL
locked root not published, live then display dark (_publish) live: stopped; dark: stuck FAIL
runtime-PM resume fails (_pm) stuck, registers untouched, map -EIO FAIL
streams don't take the disable (_unfenced) stuck FAIL
full flush, flush-queue vs strict domain (_flush_queue) FQ: stopped; strict: unchanged FAIL
gated commands, then a clean flush (_gated_and_clean) nothing changes PASS

The fix commit 4e39888 passes NULL at the two DCP shared-buffer publication flushes in apple-dart-dcp-shared.h, which are built with APPLE_DART_J713_DCP. Both are map flushes on a DCP domain, which never reaches the retirement record. The same commit updates the host harnesses that compile the production functions:

  • apple-dart-range and bcm4377-radio-sids get the new argument, with a stub apple_dart_retire_fail() that asserts no record is passed;
  • dart-s2idle-retention's stand-in domain gets retire_failed;
  • the apple-dart-fw fixture defines IS_ENABLED() as off.

kunit.py with --kconfig_add CONFIG_ARM64_16K_PAGES=y --kconfig_add CONFIG_APPLE_DART_J713_DCP=y: 48 run, 48 passed. make W=1 drivers/iommu/apple-dart.o with defconfig + asahi.config: no warnings. run-host-tests.py --only dart: 16/16, and --only bcm4377-radio: 1/1.

The panic is a static-stub hook in the tests. The existing apple_dart_test_unmap_flush_after_publish_failure still passes: both DARTs are invalidated and PM references stay balanced.

make W=1 drivers/iommu/apple-dart.o: no warnings. checkpatch --strict: both commits clean.

Testing still owed (hardware)

Shared apple-dart code needs rows on at least two generations, for example J714s (M5 Pro) plus J700 (Neo) or J516s (M3 Pro). On each Mac at ef9eb65:

  1. Boot to the desktop. The kernel log has 0 lines matching unmapped pages not retired|streams .* stopped|failed to power DART for TLB|failed to publish host page-table|Kernel panic.
  2. Media and DMA smoke: a hardware video decode (AVD) and encode (AVE), the camera (ISP) if present, NVMe I/O (a large dd), a USB storage copy, and Wi-Fi traffic.
  3. Display: compositor start, screen lock and unlock, display off and on (DPMS), and an external display plug and unplug if one is attached.
  4. One sleep and wake cycle (deep mem on J714s, a test sleep on J700), then repeat 2.
  5. Reboot and shutdown complete. 0 failed units, and 0 new kernel errors vs the default boot.

Risk

Two-way: a revert restores the old behaviour. The new behaviour only applies when a flush fails, which the old code logged and ignored. A DART that hits one (for example a display DART whose invalidate stays busy past its extended timeout) now has its streams stopped, or the kernel panics if they can't be stopped, where before it carried on with pages possibly still mapped.

apple_dart_domain_flush_tlb_range() returns the first error of a DART
that could not be powered, could not publish a locked root, or whose
TLB invalidate failed or timed out. apple_dart_iotlb_sync() discarded
it, and dma-iommu then freed the IOVA, and its caller the pages, while
that DART could still translate them. Only managed streams were
quarantined on an invalidate failure.

Fail closed instead, in iotlb_sync and, for a flush-queue domain, in
flush_iotlb_all, which retires its queued unmaps:
- A DART that failed while it could be reached (powered by the flush,
  its commands not gated) has the domain's streams disabled, and each
  TCR must read back disabled: a disabled stream reaches no memory,
  whatever its TLB or tables still hold.
- A DART that could not be reached (runtime PM did not resume it, or
  it is dark or closed for its owner's power cycle with a locked root
  left unpublished), or whose streams did not take the disable, cannot
  be shown to have stopped: panic, as the T6050 display sleep's live
  unmap already does, rather than let the pages be handed out again.
- The domain then refuses mappings with -EIO until it is freed.

Gated commands are not a failure: the DART's sleep list stopped every
stream and flushed the TLB before gating them, and nothing translates
until a restore. Borrowed DCP domains keep their own failure handling.
A flush that succeeds changes nothing.

Add KUnit cases that inject each failure: a hardware TLB invalidate
timeout, a failed firmware invalidate, an unpublishable locked root
(live, then with the display dark), a runtime-PM resume failure, and
streams that do not take the disable; that gated commands and a clean
flush leave the domain alone; and that a full flush fails closed only
for a flush-queue domain. With the failure discarded as before, all
the failure cases fail.

Signed-off-by: DjDeveloperr <[email protected]>
No check ran the apple-dart KUnit suite. Add
drivers/iommu/apple-dart.kunitconfig, list it in MAINTAINERS, and run
it in the KUnit matrix; the workflow already starts on drivers/iommu
changes.

Signed-off-by: DjDeveloperr <[email protected]>
@DjDeveloperr
DjDeveloperr requested review from a team and RyanTheTide as code owners November 26, 2026 20:34
@github-actions github-actions Bot added area:platform Area from CODEOWNERS (bot) area:release Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at 5fb10c0a: not ready yet

Check Detail
CI at head no failing: rust-build, KUnit asahi, KUnit spi-hid-apple, KUnit avd, KUnit ave, KUnit apple-dart
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 5fb10c0a
Conflicts no merge conflicts with main: merge it in (no force push)
PR text ok Risk: two-way · all Macs (shared apple-dart code). A flush failure that used to be logged and ignored now stops that device's DMA, or panics if the DART can't be reached or doesn't take the stop. Normal unmaps, gated commands during sleep and DCP-borrowed domains are unchanged. : a revert restores the old behaviour. The new behaviour only applies when a flush fails, which the old code logged and ignored. A DART that hits one (for example a display DART whose invalidate stays busy past its extended timeout) now has its streams stopped, or the kernel panics if they can't be stopped, where before it carried on with pages possibly still mapped.

Areas: area:gpu, area:platform, area:release

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr

DjDeveloperr commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

J700 (MacBook Neo, G17P) at ef9eb65196aa: PASS. There were 0 DART failure, fault, error or timeout lines through media, DMA, display power-off and a test sleep.

  • Earlier head: 4b4eba5cca54 didn't build with CONFIG_APPLE_DART_J713_DCP=y, because apple-dart-dcp-shared.h still had two 4-argument flush calls. 4e398880677b fixes that.
  • Kernel:
    • Built from the Neo's 7.3.0-41 config with LLVM=1, clean.
    • One-shot grub2-reboot with saved_entry left on 7.3.0-41.
    • The running kernel's build ID (5ced6910f41e) matched the vmlinux built from ef9eb65196aa.
  • Failure lines (unmapped pages not retired|streams .* stopped|failed to power DART for TLB|failed to publish host page-table|Kernel panic): 0 at boot, after the media and display checks, after the test sleep, and after the post-sleep checks. Also 0 DART fault/error/timeout lines, 0 invalidate timeouts and 0 WARN/BUG.
  • Media and DMA, the same before and after the sleep:
    • AVD decode (H.264 720p and 1080p, AV1 360p and 1080p tiled): 300/300 frames, matching both the software reference and stock 7.3.0-41 per frame.
    • AVE H.264 encode at 1080p: 300/300 frames, PSNR-Y 61.55 dB, byte-identical to stock.
    • Camera: 90 frames from the FaceTime HD camera, sent to /dev/null.
    • NVMe: 2 GiB O_DIRECT write and read-back, sha256 equal, temp file removed.
    • Wi-Fi: 64 MiB at 16.5 MiB/s, and 14.0 MiB/s after the sleep.
    • Scaler: NV12→ARGB32, ARGB32→NV12 and NV12→L8V0→NV12 CRCs equal stock. P010→XRGB32 times out (job timed out) the same way on stock; that's the only new error line compared with the stock boot.
  • Display:
    • kwin_wayland stayed up throughout. Lock and unlock went LockedHint yes, then no.
    • DPMS off and on: the DCP logged the panel going power on → off (M3 disabled, link shut down), then re-initialized and came back. 0 DART or invalidate errors around it.
  • Sleep: rtcwake -m mem -s 30 resumed on the same boot (suspend_stats success 1).
  • Restore:
    • Clean reboot to 7.3.0-41, PMU boot-error count 00.
    • The test kernel, initramfs, modules and BLS entry were removed, checked identical to the pre-install snapshot.
    • stock.sh identical, 0 failed units, 0 AVC denials and 0 core dumps.

apple_dart_domain_flush_tlb_range() took a fifth argument in the last
change, but the two flushes of the DCP shared-buffer publication in
apple-dart-dcp-shared.h, built with APPLE_DART_J713_DCP, still passed
four. Both publish a new mapping on a DCP domain, which never reaches
the retirement record: pass NULL.

Update the host harnesses that compile the production functions:
- apple-dart-range-tests and bcm4377-radio-sids pass NULL and stub
  apple_dart_retire_fail(), asserting that their map and attach flushes
  carry no record; their stand-in DART gains commands_gated.
- dart-s2idle-retention's stand-in domain gains retire_failed, which
  apple_dart_map_pages_unguarded() reads.
- The apple-dart-fw fixture defines IS_ENABLED() as off, so the
  KUnit-only hook in apple_dart_fw_invalidate() drops out.

In the CLOSED-gate branch, record the failure before putting the
writer's reference, which leaves the put, error and continue lines
together as dart-sleep-writer-tests' negative control expects.

Signed-off-by: DjDeveloperr <[email protected]>
…sync-fail-closed

# Conflicts:
#	drivers/iommu/apple-dart-test.c
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Verdict at ef9eb65196aa: ready

Blockers: none.

At 4b4eba5cca54 the tree didn't build with the shipped config: defconfig + asahi.config has 16 KiB pages and CONFIG_APPLE_DART_J713_DCP=y, and apple-dart-dcp-shared.h:128 and :241 still passed 4 arguments. Three host tests also failed against the new driver text: apple-dart-fw-tests, apple-dart-range-tests and dart-sleep-writer-tests. 4e398880677b fixes both. Its two callers pass NULL, which is right: they publish a fresh mapping, and nothing is freed after them.

Hardware rows and CI at this head are still owed; see the notes.

Checked

  • Every flush that frees memory afterwards goes through the new check.

    • iotlb_sync (strict unmaps) and flush_iotlb_all on IOMMU_DOMAIN_DMA_FQ domains pass a retirement record. A strict domain's full flush retires nothing and still only logs.
    • iotlb_sync_map and the two DCP shared-buffer publishes are map-side and pass NULL.
    • The v27 live unmap keeps its own panic.
    • DCP-borrowed domains return before the loop. Their invalidate failure retires the borrowed DCP through apple_dart_fail_borrowed().
    • git grep finds no other caller at this head.
  • Inside the flush, every failure source feeds the record. These are:

    • a publish failure while the display is dark or the gate is closed (stuck, since the tables its power-up walks still map the pages);
    • a runtime-PM resume failure (stuck, registers untouched);
    • a live publish failure, or a failure of any of the three invalidate kinds (full, firmware range, T8110 range).

    A live failure fences the domain's streams on that DART and reads every TCR back. -EHOSTDOWN counts as retired: the sleep list stopped the streams and flushed the TLB before gating.

  • Gating race: none found. The 250 ms display-stall wait drops dart->lock, but it is skipped on DARTs with sleep lists. Every writer of commands_gated on the remaining DARTs either holds dart->lock (apple_dart_quiesce_commands(), the system-resume gate) or runs behind the writer gate (apple_dart_sleep_power_off()). So I found no way for a gate to land between a failed command and the reachable check and turn a retired flush into a panic.

  • Locking and context.

    • apple_dart_retire_fail()/_fence() run after the invalidate has dropped dart->lock, holding only the counted writer reference. They do writel/readl and a rate-limited print, so they are safe in the atomic contexts iotlb_sync runs from. DART runtime PM is IRQ-safe.
    • apple_dart_retire_check() runs after the v27 drop.
    • The latch is WRITE_ONCE/READ_ONCE. A map_pages racing it can finish, but onto stopped streams.
    • The CLOSED branch now calls retire_fail() before writer_put(). With reachable == false it touches no register, so the order is harmless.
  • Tests.

    • The 7 new cases each inject one source and check the TCRs, the latch (map → -EIO) and balanced PM references.
    • Passing NULL again at iotlb_sync and flush_iotlb_all fails 6 of them; _gated_and_clean passes either way, as intended.
    • CI: one matrix line and a 4 KiB kunitconfig. The workflow already runs on drivers/iommu/**.
  • Rules and text. There is no new runtime switch, parameter or SoC gate, and the PR text and commits are neutral.

Notes, not blocking

  1. Display DART timeouts do happen; the owed rows must cover them.
    • Rig kernel logs show TLB command 0x1 for stream 0 timed out on the J773g external display DART (286300000.iommu, status 0x8200e100). There are 1 to 4 per boot around modesets, on a kernel built 2026-11-20, after the 250 ms stall wait landed.
    • Earlier logs show the same on J700 disp0 (0x8700e100).
    • These come from the host command path (apple_dart_t8110_hw_tlb_command_range()); the borrowed path prints a different message. The logs don't show whether those flushes were unmaps.
    • If one is, this PR now stops that display's streams for good, or panics if its TCRs are locked.
    • So the display rows should run on J773g with an external display (modeset, DPMS off/on, hot-plug) and on J700's internal panel (compositor start, lock and unlock, panel off/on, after a resume). Each should show 0 timed out, 0 streams .* stopped and 0 unmapped pages not retired lines.
  2. System sleep. Each DART's sleep callback calls pm_runtime_force_suspend(): in .suspend for s2idle, in suspend_noirq for firmware sleep. After that, pm_runtime_resume_and_get() returns -EACCES for a DART that was already runtime-suspended (drivers/base/power/runtime.c, rpm_resume()).
    • main logged failed to power DART for TLB synchronization and went on. This PR now panics there.
    • I found no consumer that unmaps in that window, so the sleep rows should grep for that line too.
    • If it ever shows up, a DART that lost power has no TLB left to retire, and that case may need to count as retired rather than stuck.
  3. TCR readback. The fence requires each TCR to read back exactly tcr_disabled (0). A DART with read-only TCR bits would be counted stuck rather than stopped. Only a failure reaches this, so no row will exercise it; noting it for whoever sees it first.
  4. CI coverage. The 4 KiB kunitconfig doesn't build the J713 code (it needs 16 KiB pages), which is how the build break slipped past KUnit and was caught only by the apple-build job. A 16 KiB variant of the kunitconfig in the matrix would run the J713 cases as well.
Evidence

Local runs, arm64 QEMU, clang. CONFIG_WERROR=n was added only because the host compiler warns in unrelated files.

4b4eba5cca54, defconfig + asahi.config (16K, APPLE_DART_J713_DCP=y), make W=1 drivers/iommu/apple-dart.o
  apple-dart-dcp-shared.h:128:65: error: too few arguments to function call, expected 5, have 4
  apple-dart-dcp-shared.h:241:65: error: too few arguments to function call, expected 5, have 4
4b4eba5cca54, run-host-tests: apple-dart-fw-tests, apple-dart-range-tests, dart-sleep-writer-tests FAIL
  (all three ok with main's drivers/iommu)

ef9eb65196aa
  kunit apple-dart.kunitconfig (4K):                    Ran 39 tests: passed: 37, skipped: 2
  kunit + ARM64_16K_PAGES + APPLE_DART_J713_DCP
        + PROVE_LOCKING + DEBUG_ATOMIC_SLEEP:           Ran 48 tests: passed: 48
                                                         0 lockdep / BUG / WARNING lines
  run-host-tests --only dart:                            16/16 passed
  defconfig + asahi.config, make W=1 apple-dart.o:       no errors, no warnings
  checkpatch --strict (both new commits):               0 errors; 1 warning on the host
                                                         fixture's "#define IS_ENABLED(option) 0" (expected there)

Mutation at 4b4eba5cca54 (iotlb_sync and flush_iotlb_all pass NULL, as before):
  retire_tlb_timeout, _fw_invalidate, _publish, _pm, _unfenced, _flush_queue  FAILED
  retire_gated_and_clean                                                       PASSED
  Ran 37 tests: passed: 30, failed: 6, skipped: 1

Rig logs (dmesg and journal captures):

J773g, 7.3.0 built 2026-11-20:
  apple-dart 286300000.iommu: TLB command 0x1 for stream 0 timed out (0x8200e100)   x4 (one boot), x1 (another)
J700, 7.3.0 built 2026-11-16:
  apple-dart 412300000.iommu: TLB command 0x1 for stream 0 timed out (0x8700e100)   x5

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J773g (M4 Mac mini) row at ef9eb65196aa: pass.

The kernel was built natively on this Mac and booted once as 7.3.0-ARCH-m4queue-ef9eb65196. Stock (7.3.0-ARCH-m4mainefed1ae3) was restored afterwards with a normal reboot: running, 0 failed units. The row was silent.

Display and compositor:

  • No external display is attached to this Mac mini. The only output is Unknown-1 at 640x1136, and it lists one mode, so there was no other mode to switch to.
  • DPMS off/on through kscreen-doctor worked.
  • A display-manager restart brought kwin_wayland back with the same CRTC mode.

DMA and media, before and after one RTC s2idle: the sleep counted as a success (+1, fail +0), the boot was the same, and Wi-Fi reconnected.

  • NVMe: 512 MB O_DIRECT read, 7.8 GB/s before sleep and 8.6 GB/s after.
  • Wi-Fi (wld0): 300 pings of 1400 bytes to the gateway, 0 % loss both times. The row's own SSH traffic also ran over Wi-Fi.
  • USB: a USB stick was de-authorized and re-authorized 3 times, with a 64 MB O_DIRECT read after each. It re-enumerated and read every time, with 0 err-level lines and 0 DART faults.
  • AVE and AVD: this Mac has no AVE video node. AVD (/dev/video12) probes, but no stateless decode client is installed (no GStreamer v4l2codecs, no ffmpeg v4l2request), so no AVD decode ran.

Kernel log, whole boot:

  • TLB command .* timed out: 0.
  • unmapped pages not retired|streams .* stopped|failed to power DART for TLB|failed to publish host page-table|Kernel panic: 0.
  • failed to power DART for TLB synchronization: 0.
  • No WARNING lines.
  • The err-level lines that stock doesn't have come from the SEP sensor probe (this Mac has no Touch ID sensor) and from dwc3 genpd_prepare returns -11 at sleep prepare. None come from the DART.

No timeout showed up, so the comparison run on main (b14959b819cf) wasn't needed.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Nov 26, 2026
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J714s (MacBook Pro 14" M5 Pro, T6050) row at ef9eb65196aa: PASS.

  • Kernel: 7.3.0-m5-rows-d3310, a warm native build of main 2094ccb2a036 + this PR at ef9eb65196aa + linux#3312 dfc98f5efa46. ASoC: apple: t8152-aop-audio: check the sense reader's pointer before using it #3312 touches only sound/soc/apple/t8152_aop_audio.rs, so there's no file overlap.
    • This PR's 11 files are identical to the head.
    • Booted with the default command line; the default kernel (7.3.0-m5-cdirect16) was restored afterwards with a clean systemctl reboot.

1. Boot: 0 kernel lines matching unmapped pages not retired|streams .* stopped|failed to power DART for TLB|failed to publish host page-table|Kernel panic, at boot and over the whole run.

2. Media and DMA smoke, run before the sleep and again after it with the same results:

  • AVD: H.264 decode 120 frames and AV1 decode 60 frames, both frame-checksum lists identical to the default kernel's.
  • AVE: H.264 encode of 120 1080p frames.
  • Camera (apple-isp, /dev/video0): 60 frames streamed to /dev/null at 18 fps. Nothing was recorded.
  • NVMe: 1 GiB O_DIRECT write (885–888 MB/s) and read (6.4–6.6 GB/s), checksum unchanged after re-reading.
  • SD card: 512 MiB O_DIRECT read (about 16 MB/s), read only. No USB storage is attached to this Mac.
  • Wi-Fi: 400 × 1400-byte pings to the gateway with 0 % loss, plus 256 MiB each way over SSH on the Wi-Fi interface.

3. Display:

  • Hyprland was up at boot with 3 outputs connected (built-in panel and 2 external DisplayPort).
  • DPMS off turned all 3 outputs off, and DPMS on brought all 3 back.
  • hyprlock locked, then unlocked.

4. One deep mem sleep (RTC wake after 20 s): 1 of 1 succeeded, then step 2 again as above.

5. Kernel log and units over the test boot:

  • 0 DART faults, 0 WARN/BUG/Oops/panic, 0 GPU faults.
  • Failed units: tailscaled.service only, the same as on the default boot.
  • The error-level lines that the default boot doesn't have are the usual after-sleep set (Wi-Fi country update, BT and a PCIe port reporting device inaccessible on D3hot→D0, genpd_prepare, mmc0: Card is consuming too much power) and DCP "unable to match service" lines from the newer main. None mention DART.

A full power-off wasn't run: this unattended lab Mac has no remote way to power back on. The clean reboot path was exercised.

@github-actions github-actions Bot added the merge-conflict Conflicts with the base branch (bot) label Nov 27, 2026

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge at ef9eb651

Blockers:

  1. Merge conflict (CONFLICTING) against main; rebase onto current main and re-run CI (3 checks were cancelled at ef9eb651).

Checked:

  • Verified mergeability (CONFLICTING) and existing J714s M5 Pro PASS row at ef9eb651.
  • Deferred final diff approval until the conflict against main is resolved and CI finishes green.
Evidence
  • Head ef9eb651 vs main: CONFLICTING; CI 25 passed, 3 cancelled.

Resolve apple-dart.c: main now counts dark-display writers under
managed_lock and sets display_tlb_stale there; keep that and still record
the dark DART's publish result in the retirement record before the writer
count drops. Every apple_dart_domain_flush_tlb_range() caller already
passes a record (or NULL where nothing is freed). Keep both sides' KUnit
cases in apple-dart-test.c and both sides' struct apple_dart fields
(commands_gated, display_writers) in the host-test harnesses.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Pushed 9539200, a forward merge of main (1957bb7) into this branch. No force push.
apple-dart.c: main now counts dark-display writers under managed_lock in apple_dart_domain_flush_tlb_range(). The merge keeps that and still records the dark DART's publish result in the retirement record before the writer count drops. Main added no new flush_tlb_range callers since this branch, and every caller passes a record (or NULL where nothing is freed), so the merge adds no call sites. apple-dart-test.c keeps both sides' KUnit cases, and the two host-test harnesses keep both sides' struct apple_dart fields.
Locally: drivers/iommu/apple-dart.o builds clean (arm64 LLVM W=1, defconfig+asahi.config, 16K, J713_DCP=y); KUnit apple-dart on arm64 QEMU passes 41 with 2 skipped (16K-only cases); run-host-tests.py --only dart passes 22/22; bcm4377-radio-sids passes.
Still needed: CI and App re-review. The existing J700/J773g/J714s rows should hold since no call sites were added. #3227 also edits bcm4377-radio-sids.py, so whichever lands second must keep both sets of entries. Thanks @DjDeveloperr.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at 9539200 after exact-head CI.

Checked: The forward merge records failed dark-DART publication before dropping main’s writer count. Retiring paths pass the retirement record and check it after the flush, while map-only and panic-on-failure paths retain their separate behavior. The updated host fixtures and reported arm64 KUnit exercise the merged implementation. If #3227 lands first, preserve both host fixture changes and recheck the landing tree.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping @DjDeveloperr: closeout merge at 9539200c. The App approved at this head after the closeout forward-merge/fix. Rows: J700 + J773g + J714s at the pre-merge head; the forward-merge adds no new flush call sites. Merging under the 6-point rule 1 h from now, once hosted CI at this head and main CI are green, unless you object.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed ci-failing A check failed at the PR head (bot) labels Nov 29, 2026
@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 29, 2026
@erikwb

erikwb commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

J716c (16-inch M5 Max, T6050) at 5fb10c0a: boots, 0 DART faults or DART errors across boot, Vulkan CTS, USB on a Thunderbolt dock and two 4K displays; no fail-closed stop or panic fired.

Evidence

Batched kernel 7.3.0-ewb368+ = main 219311530ef0 + #3605 222e0e6b + #3311 cc26f9ee + #3310 5fb10c0a + #3458 625fd0f1 + #3459 af388dc6 + #3460 f8442a49, each head merged unchanged. The J716c DTB is built without #include "t6050-media.dtsi" (main hangs the J716c at boot otherwise, #3618). One-shot trial boot on the default command line plus watchdog.open_timeout=120 (recovery watchdog for test boots only); compared with the default 7.3.0-ewb342+ on the same Mac, dock and network.

Vulkan CTS with Borealis aurora-wip 437b0b52151, 4 jobs: synchronization list (5354 cases) 4496 pass, 93 flaky, 0 fail; compute sample 490 pass, 760 skip; 0 kernel log lines during the runs, 0 WARN/BUG/Oops. At 16 jobs the machine hangs, and plain main without these PRs hangs the same way (#3621), so that is not from this change.

Exercised DARTs: GPU (CTS), the DCPs driving eDP-1 3456x2234 and two external 3840x2160 displays, the Thunderbolt/USB path to a CalDigit TS5 (USB2 480M and USB3 10G hubs enumerated as on the default kernel), and the N1 Wi-Fi (20-ping gateway run, 0% loss). Kernel errors are the same set as the default boot; failed units: aurora-peripherals.service only, same as the default boot.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

J700 (MacBook Neo, T8140) at 5fb10c0a609e: PASS. No DART fault, error or timeout lines, and none of "unmapped pages not retired", "streams … stopped", "failed to power DART for TLB", "failed to publish host page-table" or a panic. I checked at boot, after the media and display checks, after a test sleep, and after the checks that followed the sleep.

  • Kernel: 7.3.0-neo-rows3, built from main dbfbced70b31 with this head merged unchanged, plus drm/asahi: g17: bound submit syncs, install repeated timeline outputs once, return closed queues' identities at close #3200 and drm/asahi: g17: name the owning process when a compute publication gives up #3240, which touch other files. It used the Neo's 7.3.0-41 config and was booted one-shot. The running vmlinux build ID (c63915f98aca) matched the build.
  • Media and DMA, the same before and after the sleep:
    • AVD decode (H.264 720p and 1080p, AV1 360p and 1080p tiled): 300/300 frames, matching both the software reference and stock 7.3.0-41 per frame.
    • AVE H.264 encode at 1080p: 300/300 frames, PSNR-Y 61.55 dB, byte-identical to stock.
    • Camera: 90 frames from the FaceTime HD camera to /dev/null.
    • NVMe: 2 GiB of existing files read twice with O_DIRECT (sha256 equal), then a 160–180 MiB O_DIRECT write and read-back (sha256 equal, file removed). The write is small because this Neo's root filesystem is close to its free-space floor.
    • Wi-Fi: 64 MiB transfers before and after the sleep.
    • Scaler: the NV12/ARGB32 CRCs match stock. P010→XRGB32 times out the same way it does on stock.
  • Display: kwin_wayland stayed up through lock and unlock and through DPMS off and on.
  • Sleep: rtcwake -m mem -s 30 resumed on the same boot. During suspend prepare, dwc3-apple 40a280000.usb: PM: device_prepare(): genpd_prepare returns -11 was logged once; the sleep still completed.
  • Restore: rebooted to 7.3.0-41. The test kernel, modules and boot entry were removed, identical to the pre-install snapshot. 0 failed units, 0 AVC denials, 0 core dumps.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train review (non-author, per the agents-desk ask) at 5fb10c0a: the code is approved, and the fail-closed behaviour on a failed TLB retirement is the right direction. But it changes shared apple-dart behaviour on every Mac (a failed flush now stops DMA or panics), and the PR's own "Not yet" still lists hardware rows on two generations. Merges as soon as those rows are at this head (e.g. J713 + J616s, or J473 + J316s: boot, display, NVMe, Wi-Fi, a short s2idle, 0 DART faults). <@422957901716652033>

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 1, 2026

This branch has not been deployed

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

Labels

area:gpu Area from CODEOWNERS (bot) area:platform Area from CODEOWNERS (bot) area:release Area from CODEOWNERS (bot) blast:all Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) merge-conflict Conflicts with the base branch (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants