Skip to content

drm/asahi: g18: let queues opt in to returning before a submission retires - #2679

Merged
RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/g18-async-submit
Nov 22, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/g18-async-submit

Conversation

@sithglan

@sithglan sithglan commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

On the J873g (M6 Mac mini), the G18 adapter runs every submission inside the submit ioctl. It hands the job to a kworker and polls until it retires, so each glFlush blocks the caller for the whole GPU job: 0.3–1 ms usually, up to 10 ms. CPU and GPU never overlap within a client. 4K60 video in mpv drops frames, and every GL client spends its frame budget waiting in the ioctl.

Change.

  • Job worker. Accepted submissions run one at a time on a job worker, in submission order across every queue of the device, as the GPU runs them anyway.
  • Opt-in flag. A queue created with the new DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT flag (advertised by DRM_ASAHI_FEATURE_ASYNC_SUBMIT) returns from a submission with output syncs once it is accepted. The outputs signal when it retires.
  • Everything else still blocks. Every other submission returns only once it has retired: one without output syncs, or any submission to a queue without the flag.
  • Why an opt-in. Current Mesa reads G18G indirect dispatch sizes on the CPU right after a submit returns. With every queue async, that read sees stale sizes, which skips dispatches or hangs the GPU until the 10 s watchdog. Old Mesa never sets the flag, so it keeps today's behaviour. The Mesa fix and the flag are in asahi: G18G: let the kernel return from GL submissions before they retire mesa#601.

Ordering and fences.

  • Install under the lock. The output fence is installed in the syncobjs under the job queue's lock, after the job has its place. So a submission that finds the fence in a syncobj is accepted later and runs after the job that signals it.
  • Failed submissions. A submission that fails before it is accepted signals its fence before installing it. That still happens after the queue's earlier fences.
  • Input fences from other drivers. The submit ioctl waits, interruptibly, for every input fence that no G18 job signals. This includes fences inside chains and arrays: Mesa's timeline points wrap G18 fences, and those are skipped. The worker never waits on a fence. A wait there would hold every queue of the device: one client could stall all GPU work with a timeline point that wraps another driver's fence. The fence walk is a small C helper, g18/sync_input.c, like the G17 one.
  • Queue limit. A queue holds at most 32 accepted jobs; a further submit waits for the oldest.
  • Errors. An accepted job that fails after its submit returned signals its outputs with the error and logs the submitting process (G18 job failed: submission N pid P (comm): err). The queue's next submission then fails with that error: Mesa learns of a GPU fault only from a submit error, and treats the context as lost.

Session.

  • The worker runs a job on the session itself (ApplicationOwner::run) instead of handing it to a second kworker and polling.
  • is_crashed() no longer blocks on the session lock that a running job holds.
  • G18_SYNC_ONLY logs at debug level: with the Mesa fix, every indirect dispatch issues a sync-only submission.

J873g rows. This commit on the M6's current stack (#2623, #2242, #2652), with the system Mesa and with a dev Mesa carrying aurora-silicon/mesa#601:

system Mesa (no flag) Mesa with the flag
submit (glFenceSync + glFlush), asyncbench 20000 triangles + 3 ms CPU per frame 3.43 ms 0.020 ms
frame time, same run 6.48 ms 3.24 ms
synctest (indirect dispatch, XFB, GS, render→compute, shared contexts), 5 × 50 50/50 each 50/50 each

Other driver's fence, plain and inside a timeline point.

  • Setup. A raw client submits a sync-only command with a sw_sync fence as input, from a test module. The fence signals after 2 s. Meanwhile a second process renders and records its longest frame.
input old async patch, every queue async this PR
binary syncobj submit waits 2000 ms; other client's longest frame 1.3 ms submit waits 2000 ms; longest frame 3.0 ms
timeline point (a dma_fence_chain around the fence) submit returns at once; the worker waits, so the other client's longest frame is 2000.2 ms submit waits 2000 ms; longest frame 1.3 ms
  • Restart. Stopping the submitter (SIGSTOP/SIGCONT) while its ioctl waits restarts the ioctl. It returns when the fence signals, with no warning.

Error delivery.

  • Setup. A rejected submission (a garbage command buffer) leaves an error fence in its output. An async submission takes that fence as input.
  • Result. The async submission is accepted (returns 0), then fails, and its output fence carries -EINVAL. The kernel logs G18 job failed: submission N pid P (fencetest): Error(22). The queue's next submission returns -EINVAL once; the one after succeeds.

Teardown. Five GL clients were killed with SIGKILL while they had queued jobs (200000-triangle frames). There were no faults, and the next client rendered normally.

Earlier coverage, all queues async (the first version of this patch, without the opt-in; on the M6 desktop since 11-19):

  • mpv 4K60 H.264 (v4l2request), 25 s: 158 dropped frames synchronous, 0 async.
  • Blend/MSAA matrix: 54/54 against llvmpipe.
  • Chromium Maps and Firefox render correctly.

Checks.

cc @DjDeveloperr @RyanTheTide @Acelogic @LiamRay10

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

The opt-in design is the safe one. Old Mesa never sets the flag and keeps returning only after retirement, which avoids the stale indirect-size read. Other generations reject the flag through the default set_async_submit() returning -EINVAL, and fences are installed under the job queue's lock after the job has its place. The asyncbench numbers show what it buys. Points:

  • UAPI bits: DRM_ASAHI_FEATURE_G18_ASYNC_SUBMIT takes bit 39, which is free on the current tip, and drm/asahi: report the G14 firmware-27.2 device as compute-only #2610 (open) takes bit 41 for the compute-only device. Since both are in the shared uapi header, please check that no other open PR also claims 39 or 40 before this merges. The two queue-create users of flags should also keep to distinct bits.
  • Naming: the flag is generic (DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT) but the feature bit is G18-specific. If another backend later supports it, a second feature bit for the same flag would be awkward. DRM_ASAHI_FEATURE_ASYNC_SUBMIT, advertised only where supported, keeps the uapi generation-neutral.
  • Error delivery: an accepted job that fails after the ioctl returned makes the queue's next submission fail. If a client never submits again, the error only shows in its output syncs and the kernel log. The uapi comment says so. A line in Mesa's handling (mesa#601) that checks the fence error before reading results would close the loop.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan
sithglan force-pushed the thomas/g18-async-submit branch from 5a65ae0 to cc0b7b3 Compare November 21, 2026 07:19
@sithglan

Copy link
Copy Markdown
Contributor Author

Thanks. Updated to cc0b7b3, and aurora-silicon/mesa#601 to cbe72672cb4.

  • UAPI bits. I checked every open PR that touches include/uapi/drm/asahi_drm.h. drm/asahi: admit the USC cache invalidate in the G15/G16 VDM root barrier #2523 takes bit 40 (DRM_ASAHI_FEATURE_VDM_USC_INVALIDATE), drm/asahi: report the G14 firmware-27.2 device as compute-only #2610 takes bit 41 (DRM_ASAHI_FEATURE_COMPUTE_ONLY), and no other PR claims bit 39. This is the only PR that defines drm_asahi_queue_create::flags; the async flag is bit 0. I'll check again before it merges.
  • Naming. The feature bit is now DRM_ASAHI_FEATURE_ASYNC_SUBMIT, still bit 39. It is documented as reported by GPUs whose submissions otherwise return only once they have retired (G18). The flag text is generation-neutral: "On a GPU that reports it, a submission to a queue without the flag returns only once it has retired."
  • Error delivery.
    • uapi comment. It now says that a client that does not submit again learns of a later failure only from its outputs, so it checks their error before reading what the submission wrote.
    • Mesa. mesa#601 has a third commit for this. After agx_sync_batch() has waited for a batch, it reads the batch's fence status through a sync file (where the kernel reports the feature). If the batch failed, the context is reported as reset, as for a failed submission.
    • J873g row for the kernel side. An async submission takes a rejected submission's error fence as input. It is accepted (returns 0), then fails; its output fence carries -EINVAL, and the kernel logs G18 job failed: submission N pid P (fencetest): Error(22). The queue's next submission returns -EINVAL once, and the one after succeeds.
    • Mesa check. The dev Mesa with the check passes synctest 5 × 50/50. remapvm, which reads a pixel back after every frame, renders all 300 frames with the expected pixel, so the check reports no false failures.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of cc0b7b3: No blockers.

The only change since our last comment is the rename and the uapi text; the code is otherwise identical to the previous head. All three points are resolved:

  1. UAPI bits: resolved. Bit 39 is not claimed by any other open PR (drm/asahi: admit the USC cache invalidate in the G15/G16 VDM root barrier #2523 has 40, drm/asahi: report the G14 firmware-27.2 device as compute-only #2610 has 41), and drm_asahi_queue_create::flags has one user, bit 0.
  2. Naming: resolved. DRM_ASAHI_FEATURE_ASYNC_SUBMIT (include/uapi/drm/asahi_drm.h:535-540) is generation-neutral and advertised only by the G18 backend (drivers/gpu/drm/asahi/g18/drm.rs:195); other backends still refuse the flag.
  3. Error delivery: resolved. The uapi comment (asahi_drm.h:1191) now tells a client that does not submit again to check its outputs' error, and mesa#601 does that check after agx_sync_batch(). The J873g fence-error row shows the accepted-then-failed path end to end.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

I rebased this onto integration/aurora 24dc422773c9 because it had conflicts. The new head is 558aa0efab37 (was cc0b7b3af7bb).

  • The one conflict was in the asahi Makefile: drm/asahi: g17: admit A18 Pro mesh renders one client at a time #2071 added g17/mesh_exclusion.o on the line next to this PR's g18/sync_input.o. Both entries are kept, and the range-diff shows only that line.
  • UAPI: bit 39 is still free on the new base, where the highest feature bit is RENDER_MESH_OUTPUT at 38, and nothing there defines queue-create flags.
  • Checks: the asahi driver builds (arm64, LLVM 22), and tools/asahi/queue-priority-tests.py passes.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of 558aa0e: LGTM.

The range-diff against cc0b7b3 shows only the drivers/gpu/drm/asahi/Makefile line next to #2071's g17/mesh_exclusion.o. The code and uapi are unchanged. The three earlier points stay resolved: bit 39 is still free on the new base, the feature bit is the generation-neutral DRM_ASAHI_FEATURE_ASYNC_SUBMIT, and the uapi text tells clients to check their outputs' error. The queue flag is set by mesa#601 whenever the kernel reports the feature, so the async path needs no knob once both are in.

Assisted-by: LLM (Claude:Opus 5.5)

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

Adversarial review at 558aa0efab374edb433b239178b3703ffbb6ae63: REQUEST_CHANGES (1 code blocker + 1 §4 PR body disclosure blocker; CI host-tests: pass; mergeable/clean).

Blockers

  1. Container input fence errors are silently dropped (drivers/gpu/drm/asahi/g18/drm.rs:388-395, drivers/gpu/drm/asahi/g18/sync_input.c:15-31)

    • G18Job::execute() checks dma_fence_get_status(fence.raw()) directly on each outer self.inputs fence.
    • Because wait_foreign_inputs() unwraps dma_fence_chain and dma_fence_array containers via dma_fence_unwrap_for_each() and either waits on foreign leaf fences or skips G18's own leaf fences, dma_fence_enable_signaling() is never called on the outer dma_fence_array (unlike the previous synchronous submit_one(), which called dma_fence_wait_timeout() on the outer fence).
    • When G18Job::execute() later calls dma_fence_get_status() on an un-enabled dma_fence_array, dma_fence_array_signaled() (drivers/dma-buf/dma-fence-array.c:103-140) takes the lazy scan path, verifies every leaf is signaled, jumps to signal:, and calls dma_fence_array_clear_pending_error() — clearing PENDING_ERROR to 0 without propagating any leaf f->error. dma_fence_get_status() therefore returns 1 (success) even when a contained G18 or foreign leaf fence signaled with an error (e.g. -EINVAL / -EIO).
    • Similarly, for timeline syncobjs (dma_fence_chain, which Mesa uses for timeline points), drivers/dma-buf/dma-fence-chain.c never copies leaf f->error onto chain->base.error, so dma_fence_get_status(chain) always returns 1 even when a contained fence failed.
    • Fix: Add an unwrap-based status helper in drivers/gpu/drm/asahi/g18/sync_input.c using dma_fence_unwrap_for_each() (with dma_fence_put(cursor.chain) on early return) that checks dma_fence_get_status(leaf) on every unwrapped leaf fence and returns the first negative error, and call it from G18Job::execute().
  2. §4 Attribution (hard rule): missing Assisted-by: line at the end of the PR body

    • Commit 558aa0ef itself is clean (human author/committer Thomas Glanzmann <thomas@glanzmann.de>, Signed-off-by:, no agent trailers).
    • However, an agent assisted on this PR (disclosed in the 558aa0ef rebase comment as Assisted-by: LLM (Claude:Opus 5.5)), and pre-pr-checklist.md §4 requires a plain Assisted-by: disclosure line at the end of the PR body itself.

Other checks (§1–§3, §6) & verification notes

  • §1 / §2 / §3 / §6: Pass. Feature-bit + queue-flag opt-in (DRM_ASAHI_FEATURE_ASYNC_SUBMIT bit 39 / DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT bit 0) is generation-neutral, default-cmdline safe, and keeps existing userspace behavior unchanged.
  • Verified sound: OutputPublication::accept() installs output fences under JobQueue::state so cross-queue ordering holds; sync_input.c properly puts cursor.chain on early exit; G18Job holds VmJobGuard so Vm::drop_mappings defers unmaps even on non-PF_EXITING fd/queue close; dropping an unpublished UserFence on ERESTARTSYS is safe (dma_fence_release only warns when cb_list is non-empty).
  • Non-blocking nit: G18DrmGpu does not explicitly flush JobQueue on unbind/drop (currently safe because g18::probe::Driver::suppress_bind_attrs() is true and ApplicationOwner::shutdown() stops the session under the mutex before returning, causing queued jobs to exit via is_crashed()).

§5 HW evidence to include with the fix

  • On J873g (M6) at the fixed head: add the §5 regression counts (0 SELinux denials, 0 failed systemd units, 0 new kernel errors) and an error-propagation test case using a timeline syncobj (dma_fence_chain) / dma_fence_array wrapping a failed fence.
  • Because file.rs and queue/mod.rs are shared paths, include a non-G18 sanity check confirming DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT is rejected with -EINVAL and existing queues are unaffected.

Assisted-by: LLM (Gemini 4 Neon)

…tires

The G18 adapter ran every submission inside the submit ioctl: it handed
the job to a kworker and polled for its retirement, so every flush
blocked the caller for the whole GPU job (0.3 to 10 ms on the M6).

Accepted submissions now run one at a time on a job worker, in
submission order across every queue of the device, as the GPU runs them
anyway. A queue created with the new DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT
flag (advertised by DRM_ASAHI_FEATURE_ASYNC_SUBMIT) returns from a
submission with output syncs once it is accepted; the outputs signal
when it retires. Every other submission still returns once it has
retired, so userspace that reads GPU results right after a submit
(Mesa's G18G indirect dispatch sizes, before its fix) is unaffected.

- The output fence is installed under the job queue's lock, once the job
  has its place: a submission that finds it in a syncobj runs after the
  job that signals it. A submission that fails before it is accepted
  signals its fence before installing it, after the queue's earlier
  fences, as before.
- The submit ioctl waits, interruptibly, for every input fence that no
  G18 job signals, inside chains and arrays too (g18/sync_input.c). The
  worker waits for no fence: one it waited for would hold every queue of
  the device. The adapter's own fences belong to earlier jobs, which
  retire first.
- Before it runs, a job fails with the first error of any input fence,
  inside chains and arrays too (asahi_g18_fence_error()): a timeline
  point (dma_fence_chain) never carries its fences' errors, and a
  dma_fence_array whose signalling was never enabled clears its pending
  error when it is found signalled.
- A queue has at most 32 accepted jobs; a further submit waits for the
  oldest.
- An accepted job that fails after its submit returned signals its
  outputs with the error and is logged with the submitting process, and
  the queue's next submission fails with it: Mesa learns of a GPU fault
  only from a submit error.
- The worker runs a job on the session itself (ApplicationOwner::run)
  instead of handing it to a second kworker, and is_crashed() no longer
  blocks on the session lock that a running job holds.
- G18_SYNC_ONLY logs at debug level: with the Mesa fix it would log every
  indirect dispatch.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan force-pushed the thomas/g18-async-submit branch from 558aa0e to 302cdf9 Compare November 22, 2026 08:17
@sithglan

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr both points. New head 302cdf9905bd; the commit is amended.

  1. Errors inside containers: g18/sync_input.c gets asahi_g18_fence_error().
    • It walks the input with dma_fence_unwrap_for_each() and returns the first negative dma_fence_get_status() of a leaf, putting cursor.chain on the early return.
    • G18Job::execute() now calls it for each input instead of checking the outer fence.
    • So a timeline point (dma_fence_chain) or a dma_fence_array wrapping a failed fence fails the job with that error. A plain fence behaves as before.
    • The commit message says why the containers don't carry the errors themselves.
    • The asahi driver builds with W=1 (arm64, LLVM 22). checkpatch on sync_input.c reports only the existing extern warning, for the prototypes -Wmissing-prototypes needs.
  2. Attribution: the PR body ends with Assisted-by: now.

The J873g rows you list come when the J873g is free:

  • regression counts on this head;
  • a timeline-syncobj and a fence-array input wrapping a failed fence, each expected to fail the job with that error;
  • the non-G18 check that DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT is refused with -EINVAL.

Assisted-by: LLM (Claude:Opus 5.5)

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

Re-review against pre-pr-checklist.md (§1–§6) at verified live head 302cdf9905bd40e75ae18d27854666416cf05ab0: 0 code/policy/attribution/naming/CI blockers remain (host-tests: pass, mergeable/clean).

Prior blockers — resolved

  1. Container input fence error propagation (drivers/gpu/drm/asahi/g18/sync_input.c:76-91, g18/drm.rs:390-394): Fixed.
    • asahi_g18_fence_error() walks every leaf fence via dma_fence_unwrap_for_each() and checks dma_fence_get_status(fence) on each leaf, returning the first negative errno.
    • Verified against drivers/dma-buf/dma-fence-unwrap.c: dma_fence_unwrap_first() takes a reference solely on cursor->chain (cursor->array is borrowed from dma_fence_chain_contained()), so dma_fence_put(cursor.chain) on early return is exact with no leak or over-put.
    • G18Job::execute() now calls asahi_g18_fence_error(fence.raw()) per input, catching leaf errors inside dma_fence_chain timeline points and un-enabled dma_fence_array containers as well as plain fences.
  2. §4 Attribution: Fixed. Commit 302cdf9905bd carries human author/committer (Thomas Glanzmann <thomas@glanzmann.de>) and Signed-off-by: only, and the PR body now ends with Assisted-by:.

Checklist summary (§1–§4, §6)

  • §1 / §2 / §3 / §6: Pass. Generation-neutral DRM_ASAHI_FEATURE_ASYNC_SUBMIT (bit 39) / DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT (bit 0), default command line, output fences installed under JobQueue::state lock, and non-blocking is_crashed().

Holding strictly for §5 HW rows on 302cdf9905bd

As noted in your update, holding APPROVE only for the queued hardware runs on this head:

  • J873g (M6) §5 regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors);
  • J873g error-propagation rows with a timeline syncobj (dma_fence_chain) and a dma_fence_array wrapping a failed fence;
  • Non-G18 sanity check confirming DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT returns -EINVAL and existing queues are unaffected.

Ready to upgrade to APPROVE as soon as those rows are posted.

Assisted-by: LLM (Gemini 4 Neon)

@sithglan

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr the J873g rows for 302cdf9905bd.

Build.

Regression (the "with" boot, which also ran the #2652/#2680/#2758 rows):

Errors inside containers.

  • Test. Fence A is pending when it's wrapped and fails later. A is the output of a sync-only async job with two inputs: a GL draw's fence (about 120 ms of GPU work, pending at submit) and the error fence of a rejected submission (-22). While A is still pending, it is wrapped two ways:
    1. as point 1 of a timeline syncobj (dma_fence_chain);
    2. merged with the GL draw's fence into one sync file, a dma_fence_array of 2 fences.
  • Each wrapper feeds one sync-only job on the same queue. 3 runs per module:
output without with this PR
A (plain failed input) -22 -22
job waiting on the timeline point 1 (signalled, error lost) -22
job waiting on the fence array 1 (signalled, error lost) -22
the queue's next submits -22, then 0 -22, then 0

In every run A was still pending when it was wrapped (sync file status 0, num_fences 2).

Why the wrapped fence has to be pending. An earlier variant wrapped the already-failed fence itself. That test can't tell the two modules apart, because the error is gone before the driver sees the input:

  • drm_syncobj_find_fence() returns a stub fence for a timeline point that has already signalled;
  • dma_fence_unwrap_merge() drops fences that have already signalled.

Still to do: the non-G18 refusal (DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT → -EINVAL on another generation). It needs the M5, which isn't reachable right now. I'll post it when it is.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr the non-G18 row, on the M5 (J813, T8142, G17).

Build.

  • The M5's GPU module (kernel 7.3.0-aurora-j813-s2r-usb4+), from its desktop tree, with this PR's generic hunks applied: file.rs, queue/mod.rs and the uapi header.
  • The G18 hunks don't run on a G17 GPU, so I left them out.
  • "Before" is the M5's unchanged module, on the boot just before.

Test. A small client calls GET_PARAMS, then VM_CREATE, then QUEUE_CREATE four times on the same file:

step before with this PR
DRM_ASAHI_FEATURE_ASYNC_SUBMIT (bit 39) in features not reported not reported
QUEUE_CREATE, flags 0 0 0
QUEUE_CREATE, DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT -EINVAL -EINVAL
QUEUE_CREATE, unknown flag bit 1 -EINVAL -EINVAL
QUEUE_CREATE, flags 0 again 0 0
destroying both queues 0, 0 0, 0
  • With this PR the flag passes the flags check, and the queue's default set_async_submit() refuses it. The queue being built is dropped, and the file keeps working: the next create succeeds and both queues destroy cleanly.
  • Userspace sees the same error as before. mesa#601 sets the flag only when the kernel reports the feature, which G17 doesn't, and a client that tries the flag anyway gets -EINVAL as before.
  • There was no GPU job failure in either boot, and the M5 is back on its default module.

Assisted-by: LLM (Claude:Opus 5.5)

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

Final §5 re-review against pre-pr-checklist.md (§1–§6) at verified live head 302cdf9905bd40e75ae18d27854666416cf05ab0: APPROVE (0 blockers; host-tests: pass; MERGEABLE / CLEAN).

§5 Hardware Verification — Complete

  1. J873g (M6 / G18G) on 302cdf9905bd (7.3.0-aurora-j873-avd-usb4-perf+, default command line):
    • Container-fence error propagation A/B (3 runs/module, pending fence A failing with -22): both dma_fence_chain (timeline syncobj point) and dma_fence_array (2-fence merged sync file) now propagate -22 (vs. 1 / error lost prior to asahi_g18_fence_error()), with the queue's next submits returning -22 once then 0.
    • Baseline regression: 0 failed systemd units, 0 SELinux AVC denials, 0 new kernel errors (only the 3 pre-existing boot lines), and 0 job failures from this PR's paths.
    • Combined with the earlier J873g async/sync A/B (glFlush submit 3.43 ms → 0.020 ms, frame time 6.48 ms → 3.24 ms, synctest 5×50/50, foreign sw_sync binary/chain non-blocking isolation, SIGSTOP/SIGCONT restart, SIGKILL teardown), G18 coverage is thorough.
  2. Non-G18 M5 (J813 / T8142 / G17) (7.3.0-aurora-j813-s2r-usb4+, shared file.rs / queue/mod.rs / UAPI hunks):
    • DRM_ASAHI_FEATURE_ASYNC_SUBMIT (bit 39) is not advertised.
    • QUEUE_CREATE with DRM_ASAHI_QUEUE_CREATE_ASYNC_SUBMIT returns -EINVAL (and unknown flag bit 1 returns -EINVAL), cleanly drops the rejected queue, and leaves the fd healthy for subsequent flags=0 queue creation and destruction (0 GPU job failures).

UAPI & Merge Readiness

  • Verified against integration/aurora HEAD (17075e3ed26a): highest defined feature bit remains bit 38 (DRM_ASAHI_FEATURE_RENDER_MESH_OUTPUT) and struct drm_asahi_queue_create::flags has no other flags, so feature bit 39 and queue-create flag bit 0 have no collisions.
  • Prior §1–§4 and §6 checks at 302cdf9905bd remain clean (host-tests: SUCCESS, mergeStateStatus: CLEAN).

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train adversarial review (MERGETRAIN-LINUX3) at 302cdf9: no blockers. Merges clean on integration/aurora bb9f8ec, and together with #2680 (1012615); tools/asahi/queue-priority-tests.py passes on the merged tree.

The delta vs our earlier LGTM at 558aa0e is Dj's container-error fix only (asahi_g18_fence_error() in g18/sync_input.c, used from g18/drm.rs); its reference counting is balanced. UAPI: old userspace is unchanged, and every non-G18 backend refuses the flag with -EINVAL through the default set_async_submit(). Single human Signed-off-by, no Apple-internal names.

Nits (not blocking)
  1. Errors on earlier timeline points are still not seen: dma_fence_chain_walk prunes signalled earlier links, so only the head point's fence is checked. A job waiting on a later point that succeeded reports success even if an earlier point failed. Not a regression (chain errors were never propagated), but the comment claims more than the code does.
  2. The job-failure pr_warn! in g18/drm.rs is not rate-limited.
  3. Accepted async jobs are capped at 32 per queue but not device-wide (unbounded queues per file).
  4. Nothing flushes the job worker on module teardown after a plain close().

Rows: G18 (J873g) and G17 (J813) are posted; G13/G14/G14X/G15/G16 take the refusal path by code but have no hardware row.

@RyanTheTide
RyanTheTide merged commit eb6d9ec into aurora-silicon:integration/aurora Nov 22, 2026
1 check passed
@sithglan

Copy link
Copy Markdown
Contributor Author

Thanks. I'll keep 302cdf9 as it is for the train and put the four nits into one follow-up PR on top as soon as this lands:

  1. Comment: dma_fence_chain_walk() prunes signalled earlier links, so only the head point's fence is checked. The comment will say exactly that and no more. Checking earlier points would mean carrying their errors before they are pruned, and that is a separate change.
  2. Rate limit: the job-failure pr_warn! in g18/drm.rs becomes rate-limited.
  3. Device-wide cap: a cap on accepted async jobs per device, not only per queue, so that a file opening many queues can't queue an unbounded amount.
  4. Teardown: the job worker is flushed on module teardown after a plain close().

The G13 to G16 rows stay as you noted: refusal path by code, no hardware row.

Assisted-by: LLM (Claude:Opus 5.5)

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.

3 participants