Repository navigation
drm/asahi: build the G14 firmware-27.2 path without the M3 runtime - #2545
Conversation
|
Claude Opus 5.5 on @satchlj's behalf: hardware run.
Build: phellos (MacBook Air M2, J413, macOS 27.2 / 26B123 stub), default rebuilt 2026-11-20 = linux |
|
Build and host-test row from our lab (no 27.2 hardware run: our J413 is still on the 13.5 stub).
The probe dispatch only takes the 27.2 path for Review of the shared part, read against the Airs on 27.2: #2543 (comment) |
|
Claude Opus 5.5 on @satchlj's behalf. Merged #2544's new head f890a9c (the pool-slot cursor fix) as 6c5d3db. Nothing in this PR's own change is different. Cause, bisect and trials are in #2544 (comment). On phellos, with the module built from this head, h1–h8 passed 8/8 (3 × 1024 + 300 × 4096, 303/303), and the host tests passed 23/23. 🤖 Generated with Claude Code |
|
Blockers: 1.
The cfg split itself checks out. Assisted-by: LLM (Claude:Opus 5.5) |
0aac788 to
81446c7
Compare
a8d3cd3 to
3b55fec
Compare
81446c7 to
f5dfd26
Compare
3b55fec to
313361e
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Pre-PR checklist review at head 313361e8d8cf (stacked on #2544 and #2543).
Code & Kconfig Split
The CONFIG_DRM_ASAHI_G14_V27_2 split itself is clean: Sink, Job::{run,timed_out,cancel}, Queue::{new,new_g14_v27_2,submit}, m3/mod.rs, mmu.rs (FirmwareWindow/MAGIC_G14_V27_2), and task_comm() relocation handle all three enabled combinations (M3_T8122 only, G14_V27_2 only, both) and G15=n cleanly, and a G14_V27_2-only build refuses render commands with EINVAL before touching M3 symbols.
Blockers
- §4 Attribution / DCO — unsigned code-change commit (
313361e8d8cf).
Commit313361e8d8cf(Merge branch 'satchlj/g14-v27-2-compute' into satchlj/g14-v27-2-kconfig) is not a trivial merge: it introduces the new#[cfg(CONFIG_DRM_ASAHI_G14_V27_2)]gate changes onsleep_prepareandsleep_completeindrivers/gpu/drm/asahi/driver.rs, but carries noSigned-off-by:line. Per §4, every commit carrying authored changes must have a humanSigned-off-by:.- Fix: rebase this PR cleanly onto #2544's updated head so the three intermediate merge commits (
71d18e84,7d84e08c,313361e8) are dropped and the complete cfg split lives in a single cleanly bisectable, signed commit.
- Fix: rebase this PR cleanly onto #2544's updated head so the three intermediate merge commits (
- Stacked dependency blockers (#2543 and #2544).
This PR depends on #2543 and #2544, both of which have openREQUEST_CHANGESblockers that must be resolved before this branch can rebase and merge.
Pre-PR Checklist (§1–§6)
- §1 No model gating: Pass (for this PR's own diff; inherits #2544).
- §2 Production-ready, no hacks: Pass (for this PR's own diff; inherits #2544).
- §3 Safety: Pass (for this PR's own diff; inherits #2543/#2544).
- §4 Clean-room & attribution: Blocked on
313361e8d8cfmissingSigned-off-by:(Blocker #1). Non-merge commitb45a912chas human author/committer andSigned-off-by:only, and the PR body discloses agent assistance. - §5 Evidence: Partial. CI checks (
source,rust-build,kunit, DWC3/ATC matrix) are green. Still needed on the final rebased head: J413 regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors), an M3 (T8122) hardware boot row with the cfg-splitm3_submit, and a G13/G14 13.5-stub no-regression row. - §6 Naming: Pass.
Assisted-by: LLM (Gemini 4 Neon)
GPU firmware 27.2 on G14 (the M2's G14G) takes a new root: four opaque records (status, control, power, an extra block) after the UAT level descriptors, and a runtime directory of 26.x-style channels in place of the 13.5 RuntimePointers. Add that root as G14 V27_2 and a compute-only runtime on it. - fw/initdata.rs: the raw InitData and HwDataB layouts gain V27_2 (a new AGX_V27_2 version group instantiates only these two), with layout checks against 13.5. - gpu/v27_2.rs: builds the root on the records of a 13.5 G14 manager (GpuManager::build_graph with GraphProfile::G14V27_2, which maps no registers and keeps the private range below the 27.2 timestamp aperture): hardware data from the 13.5 values, the chip's 27.2 register table (hw/t8112.rs), the power and thermal controller, the idle-policy records, and one queue with a kernel-owned boot compute job. - g14_v27_2.rs: start sequence and runtime. The driver's kernel window is mirrored into the loader's shared second-level table and named in TTBAT context 0 (mmu::FirmwareWindow); the ASC is started, the GPU held powered and the boot job retired; clients then submit through the 26.x front end (m3_submit), each compute command re-encoded in the 27.2 layout from a 48-slot pool and published in order. Completion follows the queue's retired position. The firmware's event, statistics, log and trace rings are consumed as they fill. Render commands get EINVAL. - driver.rs: a G14G whose DT apple,firmware-version is 27.2.0 takes this path, before anything starts the coprocessor. There are no module parameters. Inputs come from the DT (operating points, power and thermal properties, apple,coredump-copy-buffer, the SRAM voltages the loader publishes, the UAT regions), the GPU's ID registers and the T8112 chip configuration. Unbind stops the firmware (allow-off, RTKit power-off if it does not stop, ASC halt) and keeps its memory for the rest of the boot. Signed-off-by: Satya Benson <satya@benson.earth>
Review asked for no sleep or poll loops where the firmware gives a signal. The runtime polled from delayed work every 1 ms while busy and every 20 ms when idle, and dropped every endpoint message. The firmware sends endpoint 0x20 a message after it publishes event, statistics or log records. Each message now queues one run of the service, which consumes the rings and retires completed commands; there is no idle poll and no timer. The DRM scheduler's job timeout runs the service once more, so a command the firmware never completes still hits the command timeout. A firmware crash also runs it. The service runs on its own ordered workqueue. Stop waits for published work on a condition variable the service signals, detaches the message route so nothing queues more work, and drains the workqueue, replacing the fsleep loops and the fixed 20 ms sleep. Start waits for the firmware's ready status (+0x14) instead of a fixed 1 s, and fails if the command handlers are not installed in time instead of ignoring the timeout. Installation is acknowledged by the firmware clearing the request word (+0x4c24); the old wait also required the powered-stage word (+0x4c00) to read 2, which it never did after the handlers were installed, so it always ran out its 500 ms. A failed start names the step. These and the idle-policy and running-flag waits stay bounded checks of a shared word: the firmware writes it and sends no message, as with the existing G14 device-control channel. The completion stamp is written before the firmware's post-processing advances the queue's retired position, which sends no message. When the stamp is there and the position is not, the service waits for the position for at most 2 ms. Faster retirement showed that the firmware keeps a retired command's tracking slot (+0x94) linked for a while, and can link one again after releasing it; with a fixed round-robin the pool stopped at the first reuse. Pump now takes the next slot that is neither in flight nor held. If all are held it kicks the firmware's retirement scan once and the next notification, submission or scheduler timeout retries; there is no message for a slot's release. The stop line reports the notifications received, how often the position wait ran and how many held slots were passed over. Signed-off-by: Satya Benson <satya@benson.earth>
…are records it On phellos (J413, firmware 27.2) the 300-dispatch compute check stalled at the first pool wrap on most boots: every slot was still linked in the queue's tracking list (+0x94), so no slot could be reused and the 49th command timed out (submitted=48 completed=48 skipped-slots=480). Dumps of the tracking slots at the wrap show why. The firmware records the value a slot's retirement cursor must reach (+0xc, 1 for every use) in its post-processing, which can run after the queue's retired position advances. The service retires a command as soon as the position moves, so it usually read +0xc as 0 and wrote 0 to the cursor. The firmware then never unlinked the slot. In the boots that passed, the read happened to land after the record for one slot; only that slot was ever unlinked, and the pool reused it for the rest of the run (skipped-slots near 47 per command). The polled runtime before the notification rework retired 1 to 20 ms later and usually missed the window, which is why it mostly passed. Retirement now advances the cursor only once +0xc is recorded. A slot retired before that is kept in a pending set, and its cursor is advanced when the service next runs: on the firmware's next notification, submission or scheduler timeout. That is no fixed wait. The stop line counts the deferred cursors. Signed-off-by: Satya Benson <satya@benson.earth>
313361e to
3d8b62c
Compare
f5dfd26 to
4c4f313
Compare
|
J473 (M2 Mac mini, G14G) hardware row, macOS 27.2 stub (26B123). The watchdog-backed one-shot used the packaged kernel built at
The one-shot test files were removed and the machine returned to the distro default. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at 3d8b62c36688. The cfg split now has a signed change at the head. The G14-only build uses the common submission front end and leaves the M3 render branch out. Please publish the build results for G14-only, M3-only and both enabled on this exact revision, with a legacy G14 boot and a shared M3 boot once the upstream series is ready. The parent runtime fixes in #2543 and #2544 still apply to the assembled stack.
Stage both ring entries before changing the producers. Store the packet and VM binding in the in-flight list, publish the cursors, then notify the firmware. Keep that ownership if the kick fails or another command in the packet is still in flight. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Close submission admission under the runtime mutex before unbind drains the queue. If staging a later command fails, retain the packet and its VM guard until the already-published prefix retires, then complete the fence with the staging error. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Read each SRAM operating-point voltage from the loader-provided ADT table. Refuse the handoff if the table is absent or inconsistent with the core operating points. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Select the wire layout from the loader compatibility tuple before starting the GPU and pass the register description selected by the GPU compatible. Notify suspend when the in-flight queue empties. Pending commands stay held until resume, and unrelated wakeups exhaust the original timeout budget. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal adversarial pre-PR checklist re-review (§1–§6) at 3d8b62c366887ef731b43962f1133672a85e2697.
Resolved Since 313361e8d8cf
- §4 Attribution / DCO: Rebased cleanly onto
#2544(4c4f313592fa), dropping all three intermediate merge commits (including the unsigned313361e8d8cf). The PR is now a single clean commit (3d8b62c36688) with human author/committer and humanSigned-off-by:only. - Code verification: Re-verified all 13 files in the
CONFIG_DRM_ASAHI_G14_V27_2split (Kconfig,asahi_core.rs,driver.rs,event.rs,gpu.rs,hw/{mod,t8112}.rs,m3/{m3_client,m3_submit,mod}.rs,mmu.rs,object.rs,regs.rs). All four Kconfig combinations (M3_T8122only,G14_V27_2only, both,G15=n) are cleanly separated, andG14_V27_2-only rejectsParsedHardwareCommand::RenderwithEINVALbefore referencing any M3 symbol.
Remaining Blockers
- Stacked dependency blockers (
#2543and#2544) & missing integration CI:- Base branch is
satchlj/g14-v27-2-compute(#2544), which is stacked on#2543(satchlj/g14-v27-2-shared). Both#2543and#2544are still open with activeREQUEST_CHANGESblockers (§1/§2/§3 in#2544, open blockers in#2543). - Live CI on
3d8b62c36688is 6/6 green (source,rust-build,kunit, DWC3/ATC 3/3), buthost-testsdoes not trigger against a non-integration base. Rebase/retarget ontointegration/auroraafter#2543and#2544land and confirmhost-testspasses.
- Base branch is
- §5 Evidence incomplete on exact head
3d8b62c36688:- Still needed on the final rebased head: build-matrix verification for G14-only, M3-only, and both enabled (previous matrix was on earlier head
7375638a/7fcd6e20), an M3 (T8122) hardware boot row exercising the cfg-splitm3_submit, a legacy G13/G14 13.5-stub no-regression boot row, and exact-head §5 regression gate counts (0 SELinux denials / 0 failed units / 0 new kernel errors).
- Still needed on the final rebased head: build-matrix verification for G14-only, M3-only, and both enabled (previous matrix was on earlier head
Checklist Summary (§1–§6)
- §1 No model gating: Pass for this PR's own diff (inherits
#2544blockers). - §2 Production-ready, no hacks: Pass for this PR's own diff (inherits
#2544blockers). - §3 Safety: Pass for this PR's own diff (inherits
#2543/#2544blockers). - §4 Clean-room & attribution: Pass (
3d8b62c36688carries human author/committer and humanSigned-off-by:only, 0 AI commit trailers; PR body includesAssisted-by:). - §5 Evidence: Incomplete (exact-head 3-config build matrix, M3 + 13.5-stub boot rows, regression gate counts, and
host-testsonintegration/aurorapending). - §6 Naming: Pass.
Assisted-by: LLM (Gemini 4 Neon)
|
MERGETRAIN6 source review at Merge waits for the shared slot and compute runtime fixes in #2543 and #2544. The shared-build regression to record is the M3 path with its existing runtime enabled. Assisted-by: LLM (Codex) |
Signed-off-by: Satya Benson <satya@benson.earth>
The G14 firmware-27.2 runtime reuses the 26.x submission front end (m3_submit, agx_uapi and their helpers), so it was built only with CONFIG_DRM_ASAHI_M3_T8122. Give it its own option, DRM_ASAHI_G14_V27_2 (default y), and build the shared front end when either user is enabled: - m3/mod.rs: agx_uapi, agx_compute, agx_attachments, agx_memory and m3_submit build with DRM_ASAHI_M3_T8122 or DRM_ASAHI_G14_V27_2. - m3_submit.rs: the M3 sink, queue constructor, render validation, CDM launch check, timeout handling and fence-timing profile build only with the M3 runtime; without it a render command gets EINVAL. task_comm() moves here from m3_client.rs, which now calls it here. - The G14 path's own code is gated on the new option. Like the M3 runtime, the option depends on DRM_ASAHI_G15: the firmware's UAT is adopted through that backend's handoff helpers (Uat::new_adopted, the G15 UAT table cleaning). Signed-off-by: Satya Benson <satya@benson.earth>
3d8b62c to
25ac88a
Compare
|
Codex GPT-6.2 Astra on @satchlj's behalf: Replayed the single Kconfig commit over the fixed compute head. The probe conflict now uses Ryan’s firmware-compat selector and board tables under CONFIG_DRM_ASAHI_G14_V27_2. Published heads
On each head, the Rust MMU retention harness passed the bind and teardown cache-clean checks. The batching, stamp, runtime and firmware host suites compiled with rustc and passed all 119 tests. No full kernel build or J413/J473 hardware tests were run here.
|
Bring in the restacked #2610 (6a15a79: #2545 and #2544 on #2543 152822e, the TTBAT slot PoC clean in UatShared::publish_slot). The #2979 ownership fixes it also carries are already here. The rewritten #2545/#2610 commits re-add the compute-only refusals (render rejected in m3_submit, COMPUTE_ONLY feature flag); this series supports rendering, so those resolve to this series' version. Net change: the #2543 MMU teardown fix and its retention test only. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Live pre-PR checklist re-review (§1–§6) at exact head 25ac88ae153c432faafdf64d5096a6f63e501f39 (OPEN, non-draft, MERGEABLE, base satchlj/g14-v27-2-compute).
Code, Kconfig Split & Hygiene Verification
- Clean Kconfig split on top of #2544
db645f400852: Verified all 13 changed files (Kconfig,asahi_core.rs,driver.rs,event.rs,gpu.rs,hw/mod.rs,hw/t8112.rs,m3/m3_client.rs,m3/m3_submit.rs,m3/mod.rs,mmu.rs,object.rs,regs.rs).CONFIG_DRM_ASAHI_G14_V27_2(depends on DRM_ASAHIandDRM_ASAHI_G15,default y) cleanly decouples the G14 27.2 runtime fromCONFIG_DRM_ASAHI_M3_T8122while sharingagx_*/m3_submitunderany(CONFIG_DRM_ASAHI_M3_T8122, CONFIG_DRM_ASAHI_G14_V27_2)and gatingdriver.rs:402-409(has_g14_handoff && compat == [27, 2, 0]) cleanly with Ryan’s firmware-compat selector andhw::t8112::REGISTERS_V27_2/WRITABLE_V27_2. Zero code issues in this diff. - §4 Hygiene (PASS): Single clean commit
25ac88ae153cdirectly parented on#2544db645f400852with human author/committer (Satya Benson <satya@benson.earth>), humanSigned-off-by:, zero AI commit trailers, no merge commits, and no duplicate commits. - Live CI on
25ac88ae153c:source,rust-build,kunit,DWC3/ATC builtin-no-atc, andDWC3/ATC modular-no-atcPASS (5/6);DWC3/ATC builtin-modular-atcstillIN_PROGRESSat review time.
Remaining Non-Code / Stacking Items
- Stacked dependencies: Waits on #2543 (
152822e24034) and #2544 (db645f400852,REQUEST_CHANGESforcontroller()thermal/alarm literals and §5 rows) to land, then retarget ontointegration/auroraand confirm full CI green (includingDWC3/ATC builtin-modular-atcandhost-tests). - §5 Evidence on final head: Publish build matrix results for the three Kconfig combinations (
G14_V27_2=y, M3_T8122=n;G14_V27_2=n, M3_T8122=y; both=y) plus a legacy G14 (13.5-stub) and shared M3 regression boot row with §5 gate counts (0 SELinux denials / 0 failed units / 0 new kernel errors).
Checklist Summary (§1–§6)
- §1 No model gating: Pass.
- §2 Production-ready, no hacks: Pass (for this PR’s own diff).
- §3 Safety: Pass (for this PR’s own diff; inherits #2544 thermal blocker until #2544 lands).
- §4 Clean-room & attribution: Pass.
- §5 Evidence: Incomplete (5/6 CI passed with 1 in-progress; multi-config build matrix + legacy G14 / M3 regression rows pending on final rebased head).
- §6 Naming: Pass.
Assisted-by: LLM (Gemini 4 Neon)
…config RootV27_2::controller() wrote the fast-die target, its offset, the SoC-hot alarm and the per-sensor corrections as literals. They are the values the 13.5 InitData takes from the T8112 chip config, so take them from there: HwDataA unk_8cc, unk_87c and unk_e24 (cfg.da), and the corrections from unk_coef_a/unk_coef_b, indexed from the first fast-die sensor id (7). A sensor without a coefficient refuses the start. The three remaining words (filter stages, unity scale, alarm enable) are controller constants that the 13.5 InitData also sets; they are named here. What the firmware receives is unchanged. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Live re-review at 9ced2862a42a (9ced2862a42abff5561362ab6d6ffa8120797222, delta 25ac88ae153c...9ced2862a42a) against the pre-PR checklist (§1–§6).
- Delta verified: Clean forward-merge of
#2544(181fe1878c15, thermal config wiring indrivers/gpu/drm/asahi/gpu/v27_2.rs, +21/-6) with zero unrelated changes and clean humanSigned-off-by:trailers. - CI: 6/6 green (
source,rust-build,kunit, DWC3/ATC 3/3). - Status (0 code blockers): Ready for
APPROVEonce#2543+#2544land, base retargets tointegration/aurorawith greenhost-tests, and exact-head §5 rows are recorded.
Assisted-by: LLM (Gemini 4 Neon)
|
J473 combined hardware row at Assisted-by: LLM (Codex) |
Bring the branch up to integration/aurora after the shared teardown fix (#2543) landed. The only conflict is the asahi Makefile object list: keep rtkit_dump.o from this series and the G18 objects from integration. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
# Conflicts: # drivers/gpu/drm/asahi/Makefile
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Claude Opus 5.5 on @satchlj's behalf.
Third of three PRs that replace #2473. It builds on #2544 (and #2543).
The G14 firmware-27.2 runtime reuses the 26.x submission front end (
m3_submit,agx_uapiand their helpers), so #2544 builds it only withCONFIG_DRM_ASAHI_M3_T8122. This PR gives it its own option and builds the shared front end for either user.What changes
DRM_ASAHI_G14_V27_2("Apple M2 (G14G) on GPU firmware 27.2, compute only"),default y. Like the M3 runtime, it depends onDRM_ASAHI_G15, because the firmware's UAT is adopted through that backend's handoff helpers (Uat::new_adopted, the G15 UAT table cleaning).m3/mod.rs:agx_uapi,agx_compute,agx_attachments,agx_memoryandm3_submitbuild withDRM_ASAHI_M3_T8122orDRM_ASAHI_G14_V27_2.m3_submit.rs: the M3 sink, queue constructor, render validation, CDM launch check, timeout handling and fence-timing profile build only with the M3 runtime. Without it a render command getsEINVAL.task_comm()moves here fromm3_client.rs, which now calls it here.G15 && M3_T8122.Tested
Builds against the packaged phellos kernel (7.3.0-1-up1-ARCH) in four configurations, with no new warnings from this series: G14_V27_2 + M3 runtime; G14_V27_2 without the M3 runtime; M3 runtime without G14_V27_2; and G15 off (both off).
On phellos (J413, firmware 27.2), the module built without
DRM_ASAHI_M3_T8122and loaded with no parameters, under the same watchdog arrangement as drm/asahi: G14 compute on GPU firmware 27.2 #2544: trial c4, this head: PASS, 303 of 303 dispatches, 0 bad words; normal stop; cleanrmmod; return to the default. Trial c2, an earlier version of this PR differing only in cfg attributes on helpers: the same. Each trial: Vulkan compute, 303 dispatches, every word checked, normal stop, cleanrmmod, unattended return.Head
7fcd6e20(merges the review commits of drm/asahi: share the 26.x wire helpers and clean bound TTBAT slots #2543 and drm/asahi: G14 compute on GPU firmware 27.2 #2544; no change to this PR's own files): module built against phellos's up2 default kernel and run there, trial d8: PASS, 303 of 303 dispatches, every word checked, clean stop andrmmod. Details in drm/asahi: G14 compute on GPU firmware 27.2 #2544. Also built withDRM_ASAHI_G14_V27_2and withoutDRM_ASAHI_M3_T8122, with no new warnings.Untested
m3_submitbehind cfg. They compile unchanged in M3 builds, but no M3 machine booted this.DRM_ASAHI_G15dependency. That would move the adopted-UAT helpers out of the G15 backend and is not part of this series.Assisted-by: LLM (Anthropic:Claude Opus 5.5)