Skip to content

drm/asahi: g14_v27_2: retry ring-full EBUSY and isolate packet publication errors - #3249

Merged
DjDeveloperr merged 3 commits into
aurora-silicon:mainfrom
AxxzyWasTaken:pr/g14-v27-2-ebusy-fail-packet
Dec 3, 2026
Merged

DjDeveloperr merged 3 commits into
aurora-silicon:mainfrom
AxxzyWasTaken:pr/g14-v27-2-ebusy-fail-packet

Conversation

@AxxzyWasTaken

@AxxzyWasTaken AxxzyWasTaken commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

What: Fix g14_v27_2 ring-full EBUSY handling and isolate per-packet publication failures from device-wide VmStatus:

  • Ring-room pre-check (drivers/gpu/drm/asahi/gpu/v27_2.rs): Add RootV27_2::check_work(), check_render(), and check_compute() so Runtime::pump() checks submission-ring and per-DM queue headroom before staging, avoiding avoidable staging churn when a ring is temporarily full (buffer-op renders that require a second TA entry still unwind cleanly if stage_render() returns EBUSY).
  • Bounded EBUSY retry (drivers/gpu/drm/asahi/g14_v27_2.rs): Retry transient EBUSY on both render and compute packets regardless of state.running(), bounded by COMMAND_TIMEOUT_MS via kick_due() so a permanently stalled ring expires cleanly instead of livelocking.
  • Per-packet failure isolation: Route fail_publication() and deferred publication_error handling through fail_packet(err) so an isolated packet publication error fails only that packet's fences and does not poison unrelated contexts' VmStatus, while preserving record_if_device_loss for EIO/ETIMEDOUT/ENODEV.
  • Host tests (tools/asahi/g14-v27-2-pump-ebusy-tests.py): Registered in tools/asahi/run-host-tests.py covering render/compute EBUSY retry, timeout expiry, VmStatus isolation, and 8 negative-control mutations.

Tested: python3 tools/asahi/run-host-tests.py --only g14-v27-2-pump-ebusy: 9/9 PASS (8/8 negative-control mutations killed).

  • ARM64 cross-compile (ARCH=arm64 LLVM=1 drivers/gpu/drm/asahi/aurora.o) with CONFIG_DRM_ASAHI_G14_V27_2=y (CONFIG_APPLE_SOC_SLEEP=y and =n) and CONFIG_DRM_ASAHI_G14_V27_2=n: PASS, 0 warnings in touched files.
  • git diff --check clean; scripts/checkpatch.pl --strict: 0 errors, 0 code warnings.

Not yet: On-hardware G13G (T8103) / G14G (T8112) firmware 27.2 saturation test exercising live ring-full EBUSY retries.

Risk: two-way · G13G (T8103) and G14G (T8112) GPUs running the g14_v27_2 firmware 27.2 backend; legacy 12.x/13.5 and G15/G16/G17/G18 paths are untouched.

Closes: #3070

@AxxzyWasTaken
AxxzyWasTaken requested review from a team and DjDeveloperr as code owners November 26, 2026 12:52
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m1 Macs affected, from Merge risk (bot) blast:m2 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 d02ceb7d: not ready yet

Check Detail
CI at head ok 9 checks passed
Review no approved by sithglan, but GitHub does not count it yet (code owner from Core or Omarchy Mac needed, or approval went stale)
Requested changes ok none
Hardware row at head ok comment at d02ceb7d
Conflicts ok none
PR text ok Risk: two-way · G13G (T8103) and G14G (T8112) GPUs running the g14v272 firmware 27.2 backend; legacy 12.x/13.5 and G15/G16/G17/G18 paths are untouched. Closes: #3070

Areas: area:gpu

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

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 26, 2026
@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/g14-v27-2-ebusy-fail-packet branch from 6cf0457 to a247885 Compare November 27, 2026 01:18
@github-actions github-actions Bot removed the ci-failing A check failed at the PR head (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: MERGE at a247885573aaabc43d87594295a2c01a8a0f5689 once hardware evidence is complete.

Blockers: No code blocker found. Keep the PR unarmed until exact-head firmware 27.2 ring-pressure tests on the affected G13G/G14G paths demonstrate progress and confirm another VM keeps running after the rejected packet.

Checked: Read the staging and publication changes. The precheck does not advance producer state, repeat staging revalidates the ring, the retry deadline is cleared when the blocked front advances or is withdrawn, and partially published packets retain their guard through retirement. The exact-head extracted host harness passed all 13 cases and the head CI is green. No DT, per-board gating, private material, or attribution added.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Heads-up from a batch row: this PR and #3238 both rework the same pump error paths in drivers/gpu/drm/asahi/g14_v27_2.rs (waiting_bind in #3238 vs waiting_ring here, 16 conflict hunks), so they can't be stacked as they are. #3238 now has a J473 row at its head (#3238 (comment)) and is next in the merge train. Once it lands, this needs a rebase that keeps both wait states. After that, a J473 ring-saturation row at the new head can go in the next batch boot.

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

Copy link
Copy Markdown
Contributor

#3238 is merged now (8ebb0f75). This PR needs the rebase onto main that keeps both waiting_bind and waiting_ring. Once a new head is up, a J473 + J316s row at it can go in the next batch boot.

@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Rebased onto main (d71f3b2101e15, past #3238) at a5be6ed180c0b, keeping both waiting_bind and waiting_ring in drivers/gpu/drm/asahi/g14_v27_2.rs and updating both test harnesses in tools/asahi/. Verified run-host-tests.py --only g14-v27-2-try-bind (10/10 PASS) and --only g14-v27-2-pump-ebusy (9/9 PASS, all mutations killed). Ready for the J473 + J316s batch boot.

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/g14-v27-2-ebusy-fail-packet branch from a247885 to a5be6ed Compare November 30, 2026 22:06
@github-actions github-actions Bot removed the merge-conflict Conflicts with the base branch (bot) label Nov 30, 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: HOLD at a5be6ed1

Blockers:

  • Queued hosted CI at a5be6ed1 (0P/0F/1Q): Wait for hosted apple-build, host-tests, and KUnit checks to complete green on the rebased head.
  • Exact-head firmware-27.2 hardware rows (a5be6ed1): Ready for the planned J473 + J316s batch/one-shot hardware run at a5be6ed1 verifying ring-pressure progress and isolated per-packet failure recovery (confirming unrelated VMs keep running after a rejected packet).

Checked:

  • Audited full Rust production diff (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/gpu/v27_2.rs) after rebasing past #3238 (main d71f3b2101e15):
    • waiting_bind (#3238) and waiting_ring (this PR) compose cleanly with no interference: both are reset on front removal, empty queue, fail_all, VM failure, free_slots empty, Ok(()), non-EBUSY publication error, cancel, recovery restart, and sleep/wake/restart, and each clears the other when switching between BindBusy and EBUSY.
    • RootV27_2::check_compute() and check_render() run before try_bind_vm() without advancing producer state, avoiding unnecessary VM-bind churn while a ring is full.
    • fail_publication() and deferred publication_error route through packet.fail_packet(err) with g14_v27_2_abi::guard_releasable() checks so isolated packet publication failures do not poison unrelated VMs.
    • Author verified both g14-v27-2-try-bind (10/10 PASS) and g14-v27-2-pump-ebusy (9/9 PASS, all 8 negative-control mutations killed) locally at a5be6ed1.
Evidence
  • Head commit: a5be6ed180c0ba755497fbac49d6fa35617604e3 (MERGEABLE into main).
  • Diff summary: +1898/-22 across g14_v27_2.rs, gpu/v27_2.rs, g14-v27-2-pump-ebusy-tests.py, g14-v27-2-try-bind-tests.py, run-host-tests.py.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

I checked a5be6ed with an independent host fixture that switches the same front packet from a VM-bind wait to a ring wait and back before it publishes. The previous deadline cleared on both transitions. All 14 ring cases and 10 bind cases passed against the four verified source blobs from this head. The J473 and J316s hardware rows remain.

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 1, 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: MERGE at a5be6ed180c0

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Audited full Rust production diff (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/gpu/v27_2.rs) after rebasing past #3238 (main d71f3b2101e15):

  • waiting_bind (#3238) and waiting_ring (this PR) compose cleanly with no interference: both are reset on front removal, empty queue, fail_all, VM failure, free_slots empty, Ok(()), non-EBUSY publication error, cancel, recovery restart, and sleep/wake/restart, and each clears the other when switching between BindBusy and EBUSY.
  • RootV27_2::check_compute() and check_render() run before try_bind_vm() without advancing producer state, avoiding unnecessary VM-bind churn while a ring is full.
  • fail_publication() and deferred publication_error route through packet.fail_packet(err) with g14_v27_2_abi::guard_releasable() checks so isolated packet publication failures do not poison unrelated VMs.
  • Author verified both g14-v27-2-try-bind (10/10 PASS) and g14-v27-2-pump-ebusy (9/9 PASS, all 8 negative-control mutations killed) locally at a5be6ed1.

Follow-ups (not blocking): queued CI; J473/J316s ring-pressure rows

…ication errors

Runtime::pump() on the G14 firmware 27.2 backend has two error-handling
bugs:

1. publish_render() is only entered when !state.running(), so the
   `Err(EBUSY) if state.running() => return` arm in Runtime::pump() is
   unreachable for renders. When firmware retires a prior render or
   compute command slightly before advancing the submission-ring
   consumer cursor `r`, stage_render() or stage_compute() returns
   EBUSY while !state.running() and pump() immediately fails a healthy
   packet. Even when state.running() is true on the compute path,
   returning without arming a delayed retry can stall if consumer lag
   outlives the final completion IRQ.

2. State::fail_publication() (and the deferred publication_error
   retirement path in Runtime::service_locked()) called
   packet.finish(Err(err)) (fail_vm = true), which permanently poisons
   the client's VmStatus even when the failing command was never
   published to firmware and any earlier commands of the same packet
   retired cleanly.

Fix both defects:

- Factor submission-ring and queue-head validation in RootV27_2 into
  check_work() and expose check_render() / check_compute(), calling them
  before QueueRender::prepare(), UAT binding, and pool encoding so
  transient ring consumer lag does not churn scene allocations or pool
  buffers on retry. Even if stage_render() still returns EBUSY after
  QueueRender::prepare() succeeds, Prep/Scene unwinds cleanly without
  calling queue.published() or advancing CommandPool spare buffers.
- Track submission-ring EBUSY waits in State::waiting_ring using
  FirmwareWait::kick_due(), kicking the relevant doorbell(s) at most
  once per RESOURCE_RETRY_MS and arming Notify::retry() regardless of
  state.running(). Clear waiting_ring on publication, non-EBUSY errors,
  slot-unlink waits, render-boundary waits, front withdraw() (waking
  service for a successor or notifying idle when empty), fail_all(),
  sleep_prepare(), and sleep_complete(). After COMMAND_TIMEOUT_MS, fail
  the blocked packet via State::fail_publication(packet, EBUSY) so
  VmStatus and the healthy runtime remain intact.
- Switch both State::fail_publication() (when no command of the packet
  is in flight) and Runtime::service_locked()'s deferred
  done.publication_error completion (once the published prefix retires
  cleanly) from packet.finish(Err(err)) to packet.fail_packet(err),
  matching the M3 runtime's VM isolation semantics while keeping real
  device-loss errors (EIO/ETIMEDOUT/ENODEV) and firmware hangs fatal to
  VmStatus.

Add a standalone host test harness under tools/asahi/ extracting and
compiling the production G14 27.2 runtime state machine across 13
positive scenarios and 8 negative-control mutations, and register it in
tools/asahi/run-host-tests.py.

Closes: aurora-silicon#3070
Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Rebased onto main (f06827ce52f8e) at 15c502a53c0f7, preserving the new EAGAIN sleep-retry arm alongside handle_ring_busy() in drivers/gpu/drm/asahi/g14_v27_2.rs and adding the new EAGAIN / pmgr_gpu_* / gpu_busy_held stubs to g14-v27-2-pump-ebusy-tests.py. Verified both host suites (10/10 g14-v27-2-try-bind-tests + 9/9 g14-v27-2-pump-ebusy-tests, all mutations PASS).

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/g14-v27-2-ebusy-fail-packet branch from a5be6ed to 15c502a Compare December 1, 2026 07:07
@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) merge-conflict Conflicts with the base branch (bot) labels Dec 1, 2026
DjDeveloperr
DjDeveloperr previously approved these changes Dec 2, 2026

@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.

Approved at 15c502a53c0f. check_work() is the first half of the old stage_work() moved out unchanged. It only reads positions and the ring indices (plus cache maintenance), so checking render/compute room before try_bind_vm() and prepare() has no side effects. Retrying ring-full EBUSY while work runs is bounded by the same 5 s COMMAND_TIMEOUT_MS as an in-flight command, which is below the 10 s scheduler timeout. waiting_ring is cleared on every path that also clears waiting_bind, and on a successful publish. Publication failures now go through fail_packet(), and the deferred path releases the guard under guard_releasable() like the immediate path.

Before merge: the J473 (G14G) and G13G firmware-27.2 rows at this head from Ryan's batch boot, ideally with a saturating compute load that reaches the ring-full retry. Hosted Apple build has not run at this head.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 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: MERGE at 15c502a

Checked: The rebase preserves the separate EAGAIN sleep retry, VM-bind waiting and ring-full wait paths. A temporary publication error still applies to its packet and timeout expiry remains bounded. Ran the exact-head ring and bind host suites, 13 and 11 cases respectively, with zero failures.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Hardware verification (J414s / M2 Pro, G14S B1, firmware 27.2, exact head 15c502a53c0f)

  • Target: MacBook Pro 14-inch M2 Pro (J414s, Mac14,9, SoC T6020, 16-core G14S B1), OS firmware 27.2 (mBoot-20457.41.3), Fedora 45 (graphical.target, plasmalogin + kwin_wayland).
  • Kernel & exact heads: 7.3.0-j414s-pr3249+ (main 35bfbf3875a7 + #3998 845b4ad4e079 + #3249 15c502a53c0f, merge commit 9620f0f3f479, drivers/gpu/drm/asahi/g14_v27_2.rs and drivers/gpu/drm/asahi/gpu/v27_2.rs verified byte-identical to 15c502a53c0f). vmlinuz sha256 610ba0947b16..., aurora.ko sha256 599492722fad..., boot.bin sha256 196da4c69088....
  • Boot ID: de030fc1-e607-4ad3-8807-2c9328dc7140 (aurora 406400000.gpu: G14 firmware 27.2 running; DRM device registered).

Results (PASS — 40,704 verified multi-context submits, 0 errors, 0 GPU/MMU/RTKit faults)

  • Multi-context Vulkan compute + render ring-saturation stress (each thread holds its own VkDevice/VM and fires an unthrottled burst of back-to-back vkQueueSubmit calls before waiting; every compute buffer word and rendered pixel verified against CPU reference):
    • ring-sat (10 concurrent VkDevices: 8 compute × 128 + 2 render × 64 in-flight/round × 3): 3,072/3,072 compute + 384/384 render (err=0, wait=0, wrong=0, 1.366 s vs 1.415 s base on 7.3.0-j414s-ship-38a2359d+).
    • ring-sat-heavy (20 concurrent VkDevices: 16 compute × 256 + 4 render × 128 in-flight/round × 3, 40k iters): 12,288/12,288 compute + 1,536/1,536 render (err=0, wait=0, wrong=0, 18.970 s vs 18.847 s base).
    • ring-sat-rapid (28 concurrent VkDevices: 24 compute × 256 + 4 render × 128 in-flight/round × 3, 100 iters): 18,432/18,432 compute + 1,536/1,536 render (err=0, wait=0, wrong=0, 1.442 s, ~13.8k submits/s).
  • GPU 3D / compute smoke & s2idle:
    • dEQP-VK.api.smoke.*: 8/8 PASS pre- and post-s2idle.
    • clpeak-3.1.0 --opencl --single-precision-compute: float4: 5.65 TFLOPS (float2: 5.60, float: 5.20).
    • rtcwake -d rtc0 -m freeze -s 10: rc=0, suspend_stats 0/0 -> 1/0; post-s2idle ring-sat: 3,072/3,072 compute + 384/384 render (err=0, wait=0, wrong=0, 1.435 s).
  • Kernel log: 0 GPU/MMU/RTKit faults, resets, recoveries, submission ring busy timeouts, or warnings.

Scope note

  • All 40,704 verified submissions ran through #3249's check_compute() / check_render() pre-checks on live G14S 27.2 hardware with zero regressions or faults. Because POOL_SLOTS bounds concurrent in-flight packets below RING_RECORDS = 256 / QUEUE_RECORDS = 144 when firmware drains normally, and Rust inlined the internal g14_v27_2 symbols in this release build (no handle_ring_busy symbol exposed to kallsyms/ftrace), direct hardware observation of an EBUSY retry trigger was not confirmed; that branch stays covered by the host mutation suite and any G13G/G14G peer saturation run.

Signed-off-by: DjDeveloperr <hey@djdev.me>
The pump EBUSY harness was written before main added queue urgency and
GPU auto-PM to g14_v27_2.rs. Merged with main, its extracted code no
longer compiles: Packet has no urgency, State has no auto_pm or
idle_off_allowed, set_gpu_auto_pm is missing, and KVec lacks reserve,
insert_within_capacity, first_mut and Index<RangeFrom>.

Add the same stubs main already carries in g14-v27-2-try-bind-tests.py.
Only this test file changes.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Pushed a merge of main and a test-stub fix to this branch. New head d02ceb7d7caf. The driver change looks right. Still owed: a T8103 or T8112 hardware row.

What I pushed (2 commits, no rewrite)

  • ae6204ef22d4: a plain merge of main fcd7a7423d4b into 15c502a53c0f. No conflicts. Tree 256013cdeabc.
  • d02ceb7d7caf: tools/asahi/g14-v27-2-pump-ebusy-tests.py only, +41 lines. Why: merged with current main, this harness no longer compiled (10 rustc errors), so it would have turned main's host-tests job red. Its stubs predate main's queue urgency and GPU auto-PM in g14_v27_2.rs. I added the same stubs main already has in g14-v27-2-try-bind-tests.py: urgency on Packet, auto_pm / idle_off_allowed on State, set_gpu_auto_pm, AutoPmState::clear_for_transition, and KVec::reserve / insert_within_capacity / first_mut / Index<RangeFrom>. Every stub packet gets the same urgency, so the pending queue stays in FIFO order, which is what these tests expect.
  • drivers/gpu/drm/asahi at the new head: subtree 1d697efded3e. This is the hash the T8103/T8112 row request names, so that request still applies to this head.

Review (plain words)

  • Ring-full retry. EBUSY from publication no longer fails the packet at once while the GPU is idle. It arms a wait (FirmwareWait::kick_due on waiting_ring). The wait re-rings the compute doorbell, or the announced render doorbells, at most every RESOURCE_RETRY_MS and queues a delayed retry. After COMMAND_TIMEOUT_MS it fails only the front packet, with EBUSY, and pump() moves on. Both bounds are existing constants. There is no new parameter or switch. A doorbell error during the wait goes to fail_all, as on the publish paths.
  • waiting_ring reset. It is cleared everywhere waiting_bind is: successful publication, withdraw of the front packet, an empty queue, fail_all, a scheduler timeout of the front, recovery restart, sleep prepare, wake and restart. It is also cleared on the bind-busy, EAGAIN and generic-error arms, so a stale timer can't fail a later packet early. The EAGAIN sleep arm is unchanged apart from that reset. It still waits on a delayed retry with no timeout, and the sleep paths clear both waits.
  • Pre-checks. check_compute() / check_render() run the same ring and queue checks as stage_work, before binding the VM and before queue.prepare(). A full ring therefore no longer costs a bind or a scene prepare on every retry. check_work reads positions only and writes nothing.
  • Publication errors. Both the immediate path and the deferred path (publication_error on the last flight of the packet) now use fail_packet. A command that never reached the GPU fails its fence without marking the VM failed; device-loss errors still record. The deferred path now releases the VM job guard only when guard_releasable(live, kept). Before, it released it unconditionally, even for a packet a recovery had kept. Nothing is freed twice: release_guard stays behind the same ownership test as everywhere else.
  • Small things, not blocking.
    • check_render checks room for 1 TA entry, but publish_render stages 2 TA commands when the scene has a buffer op (&ta_work[usize::from(!with_buffer)..]). It does no harm today. A render is published only when nothing is running, so its queues are empty, and an EBUSY after prepare unwinds cleanly (test_render_transient_ebusy_after_prepare_unwinds_cleanly). Checking (TILER, 2) would make the pre-check exact.
    • Any EBUSY from publish_* now takes this path and logs "submission ring busy", not only a full ring.

Checks on the new head d02ceb7d7caf (Mini)

  • tools/asahi/run-host-tests.py --jobs 3 --only g14-v27-2 in the pinned host-tests CI image (aurora-linux-host-tests:ubuntu2404): 34/34. pump-ebusy 9/9 (all 13 cases pass in the control run, 8 of 8 mutations caught), try-bind 10/10, pool 3/3, fw-window-gc 11/11, abi 1/1. Before the stub fix, the same run on the plain merge was 25/34.
  • make ARCH=arm64 LLVM=1 W=1 -j12 drivers/gpu/drm/asahi/ (clang 23.1.3, rustc 1.100.1, CONFIG_DRM_ASAHI=m, CONFIG_DRM_ASAHI_G14_V27_2=y), warm from a main output directory through an overlay: rc 0. It gives the same 38 Rust warnings as main. None are in this PR's files, and there are no C warnings.
  • Hosted checks were skipped on the old head, so the local runs above are the receipt.

Hardware

@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed needs-hw-row No hardware row at the PR head (bot) labels Dec 3, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

J473 (Mac mini M2, T8112, G14G), firmware 27.2, at exact head 15c502a53c0f: PASS under saturating multi-process load (0 failed submissions, 0 GPU/MMU/RTKit faults). The run could not show that the ring-full retry path was reached.

  • Kernel: 7.3.0-mrp3249, built from the PR head (merge base f06827ce52f8), no other patches, fleet config (only DRM_APPLE_DISPLAY_KUNIT_TEST off). One-shot boot through aura-try (aura main 70d844e3, U-Boot 5c0d5fe1) with the PR's own t8112-j473-fw27.dtb, the 27.2-stub board file with ps_gfx apple,sleep-retained. The saved default was not changed. boot_id e696e3cb-2fd5-42c3-9550-b38d30cb3c80. aurora 206400000.gpu: G14 firmware 27.2 running; DRM device registered.
  • Control: the same load on the saved 7.3.0-aurora-fleet94 (no drm/asahi: g14_v27_2: retry ring-full EBUSY and isolate packet publication errors #3249), boot 546d43b1, run right before the trial.
  • Load (gpubench, Vulkan, Borealis system Mesa):
    • compute.light at queue depths 1 and 64
    • compute.light with 16 processes
    • compute.heavy kind=alu with 8 processes
    • render.light at depth 64
    • a saturation phase: 20 concurrent processes, each with its own DRM file, VM and queue, 16 running compute.light and 4 running render.light, every one keeping 64 submissions in flight, 10 x 500 ms windows
  • Order in the trial boot: vkcube 300 frames PASS, then s2idle (rtcwake -d rtc1 -m freeze, success +1), then the load. So the whole load also ran after a resume, with the fw27 DTB.
fleet94 (control) #3249 head
all configurations ok (20/20 saturation processes ok) ok (20/20 saturation processes ok)
saturation compute us/submit per process (median, range) 1570 (1562–1650) 1839 (1739–1882)
compute.light d=64 us/submit 31.4 31.6
compute.heavy 8 procs us/submit 737 737
render.light d=64 us/submit 207 242
RTKit sends on the GPU doorbell endpoint (ep 33) during saturation 109,314 96,961
GPU/MMU/RTKit faults, submission ring busy, recoveries 0 0
  • Ring-full not shown: the retry path (handle_ring_busy) is a Rust function, and kprobes refuse it on this build ("Could not probe notrace function"). Nothing logs a retry unless it times out. As a proxy I counted apple_rtkit_send_message on the GPU doorbell endpoint. Doorbells per submission are the same in both arms (the head's count is lower in proportion to its lower submit rate), so there is no sign of extra retry kicks. The control kernel, which fails a packet on ring-full EBUSY, also had 0 failures under the same load, so this load probably never filled the ring. Treat this as a no-regression row for the change, not a test of the retry path itself.
  • Confounder (not this PR): on this boot the DCP rejected the bootloader's live session (apple-dcp 231c00000.dcp: error -EINVAL: Invalid live RTKit handoff, so apple-drm did not bind and simpledrm stayed on the HDMI). ANE firmware preflight also failed (-ENODEV). The PR touches only drivers/gpu/drm/asahi and tools, and its base is 1,932 commits behind current main. The fleet94 control ran with apple-drm up. Because the head ran headless on simpledrm, the 17% saturation us/submit difference (and the render.light difference) is not attributed to drm/asahi: g14_v27_2: retry ring-full EBUSY and isolate packet publication errors #3249.

Afterwards the Mac went back to its production default (fleet94, Enforcing, 0 failed units) with the test kernel removed. A cleaner A/B would need #3249 forward-merged onto current main (or a base build from the same merge base); I can run that if wanted.

@sithglan

sithglan commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

J313 (Apple MacBook Air M1, T8103, G13G B1, OS/GPU fw 27.2) on exact head d02ceb7d7caf2bcbe1a68dd7fce62c4531f864ac (HEAD:drivers/gpu/drm/asahi = 1d697efded3e495923b0bc6f78e56edbba5daddc): PASS

Build & Boot

  • Kernel: Linux air 7.3.0-aurora-pr3249+ #1 SMP PREEMPT_DYNAMIC Thu Dec 3 19:12:15 CET 2026 aarch64 GNU/Linux (built from exact PR head d02ceb7d7caf, CONFIG_DRM_ASAHI=m, CONFIG_DRM_ASAHI_G14_V27_2=y)
  • Boot ID: 726bdcc8-48d6-4a95-b3bb-db4d1ed52e81
  • GPU probe (dmesg):
    • aurora 206400000.gpu: Type: G13G
    • aurora 206400000.gpu: G13 firmware 27.2 running; DRM device registered
  • Userspace: Mesa 26.3.0~devel.202612020256.d1c183b2c39-5 (git-d1c183b2c3) (Borealis Vulkan / OpenGL ES 3.2 / rusticl)

Pre-s2idle Checks

  • Headless 60-frame GBM + GLES 3.2 triangle + pixel verify (render3d): PASS (3D_60FRAMES_PIXEL_CHECK=PASS sample=(64,128,191,255))
  • vulkaninfo --summary: PASS (Vulkan Instance Version: 1.4.363, Apple M1 (G13G B1), Borealis)
  • RUSTICL_ENABLE=asahi clpeak: PASS (float8 global bw 62.03 GB/s, half4 compute 2575.96 GFLOPS, int4 648.66 GIOPS, launch latency 64.67 us)
  • Multi-process Vulkan submit burst stress (vk_ringsat 3 64 — 8 compute + 2 render processes, 10 distinct VkDevices, 64 back-to-back vkQueueSubmit bursts x 3 rounds = 1,920 submits, every computed word and rendered pixel verified): PASS (failed_procs=0)

s2idle Cycle

  • rtcwake -d /dev/rtc1 -m freeze -s 10: PASS
  • /sys/power/suspend_stats: success: 0 -> 1, fail: 0 -> 0
  • GPU sleep/resume (dmesg):
    • aurora 206400000.gpu: GPU held for sleep: submitted=24173 completed=24173 pending=0
    • aurora 206400000.gpu: GPU released after sleep: running=Ok(0) pending=0

Post-s2idle Checks

  • Headless 60-frame GBM + GLES 3.2 triangle + pixel verify (render3d): PASS (3D_60FRAMES_PIXEL_CHECK=PASS sample=(64,128,191,255))
  • vulkaninfo --summary: PASS (Apple M1 (G13G B1), Borealis)
  • RUSTICL_ENABLE=asahi clpeak: PASS (float8 global bw 61.96 GB/s, half4 compute 2557.30 GFLOPS, int4 648.61 GIOPS, launch latency 54.11 us)
  • Multi-process Vulkan submit burst stress (vk_ringsat 3 64, 1,920 submits): PASS (failed_procs=0)

dmesg Audit & Host Tests

  • GPU / MMU / DART / RTKit faults: 0
  • Kernel WARN / BUG / Oops / timeouts: 0
  • "submission ring busy" / "command publication failed" lines: 0
  • Host unit harnesses at d02ceb7d7caf:
    • tools/asahi/g14-v27-2-pump-ebusy-tests.py: 13/13 PASS
    • tools/asahi/g14-v27-2-try-bind-tests.py: 14/14 PASS

@sithglan sithglan 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.

Reviewed d02ceb7d7caf2bcbe1a68dd7fce62c4531f864ac (drivers/gpu/drm/asahi/g14_v27_2.rs, drivers/gpu/drm/asahi/gpu/v27_2.rs, and tools/asahi/g14-v27-2-pump-ebusy-tests.py):

  • waiting_ring: Option<FirmwareWait> is properly cleared on all completion/quiesce/shutdown/poison transitions, and handle_ring_busy() bounds ring-full EBUSY retries (try_begin_wait -> record_timeout_or_fatal -> fail_publication) while leaving the packet at the queue head and releasing the GPU busy hold cleanly on wait.
  • Pre-publication failures (fail_publication) fail only the offending packet via packet.fail_packet(err) without poisoning the runtime or stalling unrelated queued work, and StagedRing (check_render() / check_compute()) ensures multi-stage packet checks run before advancing the firmware ring.
  • d02ceb7d7caf brings the pump-EBUSY host test stubs in line with main's urgency and auto-PM state (13/13 PASS in g14-v27-2-pump-ebusy-tests.py and 14/14 PASS in g14-v27-2-try-bind-tests.py).
  • Verified live on J313 (Apple M1 Air, G13G B1, fw 27.2) across pre/post-s2idle GLES/Vulkan/OpenCL and 10-process 1,920-submit ring-saturation stress with 0 faults (receipt posted above).

@DjDeveloperr
DjDeveloperr merged commit 24970e1 into aurora-silicon:main Dec 3, 2026
10 checks passed
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) blast:m1 Macs affected, from Merge risk (bot) blast:m2 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (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.

drm/asahi: g14_v27_2: pump() fails render on transient EBUSY and poisons VmStatus on pre-publication errors

4 participants