Repository navigation
drm/asahi: g17: M5: drop the unreachable EAGAIN retry of a host-port submission - #2437
Conversation
…submission
Firmware::submit_m5_render_pair() wrote a render pair's records, then the
transaction through the M5 host command port, and on EAGAIN dropped the
pair view, took the registration power hold and tried once more.
Firmware::submit_m5_work() had the same retry for a single transaction.
Both were added with the M5 host-port submission.
G17Resources::submit_m5_work() cannot return EAGAIN: it returns Ok on a
J813 forms boot, ENODEV once the register mapping is revoked, and
otherwise only the result of try_write64(), which fails with EINVAL for
an offset outside the mapping. The host command port needs no core
power ("Core activity is not a prerequisite"), so no powered-state check
exists that could refuse the transaction. The retry branch has never
run, and the hold it would have taken is a no-op on M5 anyway: the
V26A428_M5 variant has registration_power_hold false, since its firmware
powers the cores for work by its own policy. Firmware::submit_m5_work()
has no caller.
Write the pair and submit once; any error propagates as before. Remove
the uncalled single-transaction wrapper. Behaviour is unchanged on every
SoC: the removed branch was unreachable.
Fixes: 9b1f778 ("drm/asahi: g17: M5: install M5 queues and submit through the host command port")
Signed-off-by: Ryan Murray <[email protected]>
|
No blockers. I checked the claim that
Only host-tests ran on this head; rust-build did not run. The local HW row: M5 (J775D), when available: vkmark headless and dEQP-VK.api.* match the base pass count, with 0 device losses, 0 AVC, 0 failed units and no new GPU errors. This is not required for merge, since the removed branch was unreachable. Assisted-by: LLM (Claude:Opus 5.5) |
|
Re-check at 3c53d3e against current integration/aurora. The EAGAIN branch is still unreachable: One wording nit:
Assisted-by: LLM (Claude:Opus 5.5) |
There was a problem hiding this comment.
Formal §1–§6 pre-PR review at verified live head 3c53d3e2095c8f8b831e5db9f93367d565af369c against live integration/aurora (70a00e583b03, not superseded).
Verified Clean
- Unreachability & ordering (§1–§3): Confirmed against live
drivers/gpu/drm/asahi/regs.rs:662-675(G17Resources::submit_m5_work()returnsOk(()),ENODEV, orEINVALfromtry_write64(), neverEAGAIN),g17/fw/variant.rs:222-227(V26A428_M5.registration_power_hold == false), andg17/mod.rs:905-944(Firmware::submit_m5_work()has no callers;submit_m5_render_pair()preserves pair view -> prepare ->commit_accounting()-> host-port write ->publish_inner()-> publish/next order;acquire_registration_power()retains its caller atg17/runtime/render.rs:686). - Attribution (§4): Single commit
3c53d3e2095ccarries human author/committer and humanSigned-off-by:only (zero AI commit trailers); PR body discloses assistance.
Blockers Before APPROVE
- Inaccurate doc comment vs live
integration/aurora(drivers/gpu/drm/asahi/g17/mod.rs:903-906):"The host command port needs no core power, and its transaction fails only once the register mapping is gone; the error propagates."contradicts liveregs.rs:681-701(submit_m5_work_held(), used byg17/runtime.rs:1611for M5 compute kicks, holdsG17_GATING_HOLDacross the host-port transaction) and omitsEINVALfromtry_write64()offset bounds checks.- Please scope the statement to render-pair host-port submission (
submit_m5_work()) and note bothENODEVandEINVALerror propagation.
- §5 / §6 Exact-head build & M5 verification evidence:
- Only
host-testsran on3c53d3e2095c(2026-11-19on stale base0abc2f385e54), which does not compiledrivers/gpu/drm/asahi/g17/mod.rswithrustc; the local build reported in the PR body was on an unmerged combined tree. - Zero M5 hardware run has been recorded (M5 is the only SoC executing
submit_m5_render_pair()viainit.is_m5()); the2026-11-20combined-kernel boot covered only non-M5 Macs and omitted numeric §5 regression counts. - Please rebase onto live
integration/aurora, verify an exact-headdrivers/gpu/drm/asahi/Rust build cleanly, and post an exact-head M5 smoke + regression triad (0 SELinux denials [or N/A], 0 failed units, 0 new kernel errors).
- Only
Non-Blocking Note
- Open PR #2433 (
f4db4c48daf1) also deletesFirmware::submit_m5_work()indrivers/gpu/drm/asahi/g17/mod.rs; coordinate so only one PR carries that hunk.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at e88b21d5cb21: the code is ready; it needs only a row at this head.
Blockers: none in the code. Missing row: none for the code. The host-port submission can't return EAGAIN: try_write64() fails only with ENODEV or EINVAL. So this only removes an unreachable retry, with no runtime change. I updated the branch to main so rust-build compiles g17/mod.rs in CI; it merges once that's green.
Checked: no Apple material, no gates. One path removed in drivers/gpu/drm/asahi/g17/mod.rs, and the local make drivers/gpu/drm/asahi/ build passes. This replaces my earlier review.
Evidence
Nit: the new comment at g17/mod.rs:903-906 says the host port "needs no core power". submit_m5_work_held() (regs.rs:681-701) holds G17_GATING_HOLD for compute kicks, and the error can be ENODEV or EINVAL. Scope it to the render-pair submit_m5_work() path.
Superseded by the review at e88b21d
DjDeveloperr
left a comment
There was a problem hiding this comment.
Clean forward-merge of main for the #3089 M3 host-test fix; code diff unchanged and prior approval stands.
Problem
Firmware::submit_m5_render_pair()(drivers/gpu/drm/asahi/g17/mod.rs:915-944 at 0abc2f3) wrote an M5 render pair's records, then the transaction through the M5 host command port, and onEAGAINdropped the pair view, took the registration power hold and tried once more.Firmware::submit_m5_work()(mod.rs:903-913) had the same retry for one transaction. Both came with 9b1f778 ("drm/asahi: g17: M5: install M5 queues and submit through the host command port").The retry cannot run.
G17Resources::submit_m5_work()(regs.rs:662) returnsOkon a J813 forms boot,ENODEVonce the register mapping is revoked, and otherwise only the result oftry_write64(), which fails withEINVALfor an offset outside the mapping. It has never had a powered-state check: the host command port needs no core power. The power hold the retry would have taken is also a no-op on M5, because theV26A428_M5variant setsregistration_power_holdto false (its firmware powers the cores for work by its own policy).Firmware::submit_m5_work()has no caller.Change
The pair is written and submitted once, and any error propagates exactly as the old non-
EAGAINarm did. The uncalled single-transaction wrapper is removed. The doc comment now says why no retry exists.Only M5 (T6050/J775D and the other M5 parts on the 26A428 M5 variant) reaches this function, through
runtime/render.rs:724wheninit.is_m5(). The removed branch was unreachable there, so behaviour on every SoC stays the same.Testing
ARCH=arm64 LLVM=1:make prepareandmake drivers/gpu/drm/asahi/build. The module's 13 remaining rustc warnings are existingdead_codewarnings elsewhere in g17/g16/mmu/regs; none is in the touched code.Still to run
init.is_m5()). On the Neo and J616s, a regression smoke is enough:vkmark --winsys headlessandglmark2-es2-drm --off-screenshould pass N/N as on the base, with 0 device losses.vkmark --winsys headlessand the deqp-vkdEQP-VK.api.*subset should match the base pass count, with 0 device losses.Thanks to Diljit Singh (DjDeveloperr), who wrote the M5 host-port submission.
Hardware rows (combined test kernel, 2026-11-20)
This change was booted in a combined test kernel: integration/aurora 0abc2f3 plus the open gate-sweep drafts plus this and the related drafts (7.3.0-aurora-hk2/pwr1/hk3). It ran once on each lab Mac (M1 Pro J316s, M2 J413, J616s, Neo J700) and was compared against the production kernel on the same Mac, using the same silent row script:
M1 Pro, M2 and J616s matched production on every row, apart from the new counters and lines the drafts add. The Neo row found the old-DTB display regression that #2358's follow-up commit fixes.
This PR: Only M5 reaches this code; boot-clean regression rows only. GPU device-loss lines: 0 on all four Macs.