Repository navigation
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 |
|
Thanks for the split. This step drops all the module parameters and the timed re-kick, and selects the path by G14G plus One point is left. We avoid sleep/poll loops where the firmware gives a signal:
Could completion and ring service run from the firmware's endpoint messages (as the existing G14 path does), with the idle poll gone, and |
|
Claude Opus 5.5 on @satchlj's behalf. @RyanTheTide: done in
One finding the old poll had hidden. With completion now sub-millisecond, the fixed round-robin over the 48 pool slots stopped at the first reuse: the firmware kept the retired command's tracking slot (+0x94) linked indefinitely, and a diagnostic run showed it linking slot 0 again after releasing it. Pump now takes the next slot that is neither in flight nor held. If all 48 were held, it kicks the retirement scan once and the next notification, submission or scheduler timeout retries. I don't know why the firmware holds slots this way; the PR body says so.
Trials d1–d7 were the failures that led here: the never-satisfied command-service condition (d1), then the held-slot stall at command 48 (d2–d7, including the diagnostic run). Each one stopped the firmware cleanly and returned unattended. Untested: everything in the body's Untested list, and in particular all 48 slots held at once, concurrent clients, and runs much longer than 303 dispatches. |
|
Thanks for 9454ef4, it covers what we asked:
The waits that remain are bounded, poll words the firmware writes without sending a message, and say so in a comment. That's fine. The held tracking-slot finding is worth keeping in the description, as you did. We'll run rows on our M2 (J413, 27.2) on this head: compute workloads, rmmod and reload, and one s2idle cycle. |
|
Claude Opus 5.5 on @satchlj's behalf. New commit f890a9c on this branch fixes a pool-slot stall in the notification rework (9454ef4). #2545 has it merged as 6c5d3db. Symptom. On phellos (J413, firmware 27.2) the 300 × 4096 compute check stalled at the first pool wrap on most boots. Every slot was still linked (+0x94), so the 49th command was never published: Bisect. The asahi tree of the up2 trial that passed (d8) is byte-identical to this branch, so the base kernel was not the cause.
Cause. Dumps of the 48 tracking slots and the queue's timestamp queue at the wrap (diagnostic module, 7 runs):
The firmware writes Fix. Tested on hardware. phellos (J413, macOS 27.2 stub 26B123), up3 default kernel 7.3.0-1-up3-ARCH, this branch's module built against it, loaded with no parameters, trial loader Host tests. Untested. Workloads other than this serial Vulkan compute check (many commands in flight at once, several clients). Render is still out of scope. The boot job's own tracking slot is never retired; it stays linked at the tail of the list, which these runs show is harmless. 🤖 Generated with Claude Code |
|
Thanks for f890a9c and the clear bisect. Advancing a slot's cursor only once the firmware has recorded We will run our M2 (J413, 27.2) rows on f890a9c rather than on 9454ef4: compute workloads, rmmod and reload, and one s2idle cycle. We'll post them here. |
|
Claude Opus 5.5 on @satchlj's behalf. Open finding at f890a9c (not fixed): s2idle with the GPU bound, then a hang around unload. On phellos (J413, 27.2, up4 kernel with this series, GPU published by aura#402 at 10373aae, aurora autoloaded), one boot, 2026-11-20:
So the 27.2 runtime has no suspend handling. The gfx domain can't reach its target while the firmware is up, and an unload after that may not be safe. Until this is handled, the series should keep the GPU unpublished by default. Next steps:
Untested: s2idle with the GPU idle but bound, without any later unload. 🤖 Generated with Claude Code |
|
Thanks for flagging the s2idle finding at f890a9c rather than leaving it for a reviewer to hit. Agreed that the GPU should stay unpublished by default until suspend is handled. For the fix, we would prefer a suspend callback that stops the firmware through its own shutdown handshake and starts it again on resume, over refusing suspend, so a bound GPU does not block sleep. If the stop path turns out to be what hangs after the s2idle, that would be good to know first. Our M2 rows on f890a9c will cover compute, rmmod and reload now; we will keep the s2idle row for the head that adds suspend handling. |
|
Claude Opus 5.5 on @satchlj's behalf. Suspend handling is in as 0aac788 ("let the G14 firmware-27.2 GPU through suspend-to-idle"), merged into #2545 as a8d3cd3. That merge only moves the callbacks' cfg gate to What hung, first. It was not the stop path. The driver had no callback for suspend-to-idle (its Your preferred design, tried first. Stop through the firmware's handshake (idle policy allow-off, then wait until it reports not running) and start it again on resume (keep-powered).
I did not go further into that. A cold restart (ASC halt, then start again) is not possible with this runtime, because its stop keeps the firmware's memory for the rest of the boot. What the commit does instead.
Rows (phellos, up4 default kernel df62a8c + our PRs, this commit as the module, aura#402 Stage 2 with the property). Each boot ran 3 × 1024 + 300 × 4096 Vulkan compute dispatches with every word checked, then one rtc1 s2idle, then the same again. No unload anywhere: rmmod after s2idle was never run.
For s3–s5, the test's watchdog pinger kept the test's SSH session open, so the reboot step never ran; WD1 reset the machine instead. A control boot without s2idle (s6) did the same, and s7 with the fix rebooted cleanly. Every boot logged "GPU held for sleep: submitted=303 completed=303 pending=0" and "released after sleep: running=Ok(1)". Untested: sleep with commands queued in |
|
Thanks for trying the handshake route first and for the clear account of why it can't work here. Knowing that the hang was genpd gating the domain under a running firmware, not the stop path, is very useful, and given the restart crash, holding publications, draining, and keeping the domain through We'll run our s2idle row on 0aac788 with the #2614 property: compute before and after, a few cycles in one boot, and the power drawn during the sleep, since the GPU now stays powered through it. |
949b48b to
259dd1a
Compare
0aac788 to
81446c7
Compare
With the G14 firmware-27.2 runtime bound, a suspend-to-idle on phellos
(J413) left the GPU unusable. At the wake the GFX power domain did not
come back ("PS gfx: Failed to reach power state 0xf"), and the next GPU
access, a compute dispatch or an unbind, hung a CPU. The driver had no
callback for that sleep. Linux gated the domain under the running
firmware, as on J713 before apple,sleep-retained.
The domain is now kept through the sleep by the device tree
(apple,sleep-retained on the J413 firmware-27 GFX domain). Before
suspend-to-idle, the runtime holds new publications and lets published
commands retire, so the sleep starts with nothing in flight; after the
wake it publishes what was held. The firmware keeps running with its
keep-powered policy. The ASC, the root and every mapping stay as they
are.
Its own power-off handshake (idle policy allow-off before the sleep,
keep-powered after it) was tried and not kept: the firmware crashed in
the wake that followed it.
The sleep is refused (EBUSY) if published work does not retire within
the stop drain time. A sleep that powers the SoC down is still refused:
the firmware would be lost, and this runtime has no cold restart.
Signed-off-by: Satya Benson <satya@benson.earth>
f5dfd26 to
4c4f313
Compare
a111d34 to
119cce5
Compare
|
Re-checked at 4c4f313. This is a rebase onto the updated Assisted-by: LLM (Claude:Opus 5.5) |
|
Test rows from a second G14G machine: Mac mini M2 (J473, T8112) on the macOS 27.2 stub, GPU published by the Stage 2 from aurora-silicon/aura#402. Kernel: This stack, unchanged (state cap 100):
Two dispatches that hang the firmware at the first state, both deterministic:
After the timeout the runtime is marked failed and every later client gets ENODEV until reboot. A lab build that prints the MMU fault status on a timeout reads Performance states (lab builds, only the globals +0x98 cap changed):
So the cap tracks the state index in hundredths, states 1–5 run here, and the hang starts at state 6 (1236 MHz / 875 mV in the DT). A fixed 500 would be another magic number, so we are not proposing it as a change; it narrows where the 27.2 state-change inputs go wrong. Not tested here: render (refused, as expected), suspend, more than one client at a time. Row details
Assisted-by: LLM (Claude:Opus 5.5) |
|
Follow-up to the J473 row above: a three-word change on top of this stack runs every performance state and fixes the two compute hangs. It is one commit on #2610's head (patch below); happy for you to take it into the series in whatever form you prefer. What it changes (
Rows on the J473 (firmware 27.2, fleet command line, no module parameters, one-boot trials, aura#402 Stage 2):
Also tried: the full 13.5 Still open on this machine: PatchFrom 959b0b3128c4dbb8c421f06e55137fd609e36a48 Mon Sep 17 00:00:00 2001
From: Ryan Murray <ryan@aurorasilicon.org>
Date: Mon, 23 Nov 2026 06:59:46 +1100
Subject: [PATCH] drm/asahi: G14 firmware 27.2: run every performance state,
and set the compute start word the 13.5 path sets
The 27.2 G14 runtime kept the GPU at its first performance state
(globals +0x98 = 100). Two things kept the other states and some
dispatches from working:
- The temperature alarm's per-state table is copied from the 13.5
configuration, but the word before it (the 13.5 HwDataShared3
position of unk_8) stayed 0. The alarm then runs in every state, and
at the upper states the firmware stops retiring work (no fault). No
machine property describes the alarm's hysteresis or retry interval,
so keep it off: a floor of the DT state count lies above every state.
The state cap is then the DT ceiling, like +0x88/+0x8c.
- The compute start operation keeps the 13.5 G14 StartCompute layout
(unk_pointer +0x04, job parameters +0x0c, stats +0x14, queue +0x1c,
VM slot +0x24). Its +0x28 word is 13.5's unk_28, which the 13.5 path
sets to 1; with 0, an integer dot-product kernel and a maximum
threadgroup-memory dispatch never retire.
On a J473 (Mac mini M2) with firmware 27.2: all eight DT states run,
fp32 3.5 TFLOPS instead of 1.0, the int8 dot-product and
max_workgroup_memory.1 dispatches complete, the dEQP-VK compute subset
is unchanged (738/776, 0 failures) and a 10-minute soak is clean.
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
---
drivers/gpu/drm/asahi/gpu/v27_2.rs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/asahi/gpu/v27_2.rs b/drivers/gpu/drm/asahi/gpu/v27_2.rs
index 8db6c0ded49fd..720c2fd425d3b 100644
--- a/drivers/gpu/drm/asahi/gpu/v27_2.rs
+++ b/drivers/gpu/drm/asahi/gpu/v27_2.rs
@@ -37,9 +37,6 @@ const TRACE_RECORDS: u32 = 512;
const RING_RECORDS: u32 = 256;
/// Queue capacity at position block +0x50 (16 x the 0x50 channels).
const QUEUE_CAPACITY: u32 = 0x500;
-/// Upper performance-state cap, in hundredths, at globals +0x98: the first state above idle.
-/// Only this cap has run on hardware.
-const STATE_CAP: u32 = 100;
/// Board facts the root needs, read from the device tree at probe.
pub(crate) struct BoardV27_2 {
@@ -119,6 +116,8 @@ fn encode_compute(
put64(cmd, 0x334, timestamps + 0x20);
put32(stream, 0, 11);
+ // 13.5 StartCompute.unk_28, at the same place in this layout (the 13.5 G14 path writes 1).
+ put32(stream, 0x28, 1);
put64(stream, 0x160, job.sequence);
put64(stream, 0x04, cmd_va + 0x18);
put64(stream, 0x0c, cmd_va + 0x68);
@@ -810,7 +809,7 @@ impl RootV27_2 {
data[offset..offset + 2].copy_from_slice(&value.to_le_bytes());
}
let ceiling = pwr.perf_max_pstate * 100;
- for (at, value) in [(0x84, pwr.max_power_mw), (0x88, ceiling), (0x8c, ceiling), (0x98, STATE_CAP)] {
+ for (at, value) in [(0x84, pwr.max_power_mw), (0x88, ceiling), (0x8c, ceiling), (0x98, ceiling)] {
put32(data, at, value);
}
put32(data, 0x6e, 1);
@@ -942,6 +941,11 @@ impl RootV27_2 {
for (word, value) in policy[0x62b8..0x62f8].chunks_exact_mut(4).zip(cfg.shared3_tab) {
word.copy_from_slice(&value.to_le_bytes());
}
+ // The temperature alarm's service floor, the word before its per-state thresholds (13.5
+ // HwDataShared3 places it there too). The alarm runs only in states at or above the
+ // floor. Nothing on the machine describes the alarm's hysteresis or retry interval, so
+ // keep it off: a floor of the DT state count lies above every state.
+ put32(policy, 0x62b4, pwr.perf_states.len() as u32);
// Cold-wake operand: the board's base operating point.
put32(policy, 0xa4, pwr.perf_base_pstate);
for (source, bits) in [
--
2.54.0Assisted-by: LLM (Claude:Opus 5.5) |
RyanTheTide
left a comment
There was a problem hiding this comment.
Independent source review at 4c4f313592fa. The suspend follow-up drains current work, but the earlier submission and safety findings are still present in the current source. The SRAM table is optional and the missing-table path still invents a voltage floor. In Runtime::submit(), the health check is still before the state lock, and pump() still has a fallible in-flight insertion after publication. Please close those earlier findings, then exercise both suspend recovery and unbind with the final device-tree handoff. The register layout and firmware ABI selection also need a hardware-described contract shared with the loader.
|
Please establish in-flight ownership before publishing the compute ring entries, and retain that ownership through retirement or confirmed shutdown if notification returns an error. The staged submit path can keep the same invariant for both compute and render. |
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>
|
J473 on the 27.2 stub, with the Stage 2 handoff from aurora-silicon/aura#402 and trial kernel
The first row successfully retired a command on a client-created queue after the firmware bootstrap retired. Both rows restored fleet85 with the saved default, empty Against this PR's The exact-head unbind and suspend rows, firmware selection, and machine-sourced thermal settings still need qualification. Three git am patches for 4c4f313From 27d1f77bb267eaea865880fe20c9fbda3223d313 Mon Sep 17 00:00:00 2001
From: Ryan Murray <ryan@aurorasilicon.org>
Date: Mon, 23 Nov 2026 21:57:08 +1100
Subject: [PATCH 1/3] drm/asahi: establish G14 compute ownership before
firmware publication
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>
---
drivers/gpu/drm/asahi/g14_v27_2.rs | 48 ++++++++++--------
drivers/gpu/drm/asahi/gpu/v27_2.rs | 79 ++++++++++++++++++++----------
2 files changed, 82 insertions(+), 45 deletions(-)
diff --git a/drivers/gpu/drm/asahi/g14_v27_2.rs b/drivers/gpu/drm/asahi/g14_v27_2.rs
index 773693a0cdfcb..9e6697eda1d2e 100644
--- a/drivers/gpu/drm/asahi/g14_v27_2.rs
+++ b/drivers/gpu/drm/asahi/g14_v27_2.rs
@@ -395,6 +395,7 @@ impl Runtime {
}
let mut guard = self.state.lock();
let state = Option::as_mut(&mut *guard).ok_or(ENODEV)?;
+ if !self.healthy() { return Err(EIO); }
state.pending.push((packet, 0), GFP_KERNEL)?;
self.pump(state);
Ok(())
@@ -417,7 +418,9 @@ impl Runtime {
self.healthy.store(false, Ordering::Release);
self.idle.notify_all();
for (packet, _) in state.pending.drain(..) {
- packet.release_guard();
+ if !state.inflight.iter().any(|flight| Arc::ptr_eq(&flight.packet, &packet)) {
+ packet.release_guard();
+ }
packet.finish(Err(error));
}
// Published work stays owned: the firmware may still read it.
@@ -447,7 +450,7 @@ impl Runtime {
/// Publishes pending commands while pool slots are free.
fn pump(&self, state: &mut State) {
self.acknowledge(state);
- if self.asleep.load(Ordering::Acquire) { return; }
+ if !self.healthy() || self.asleep.load(Ordering::Acquire) { return; }
while state.inflight.len() < POOL_SLOTS - 1 && !state.pending.is_empty() {
// A slot is reused only once the firmware has unlinked it from its tracking list
// (+0x94), which its retirement scan does after the slot's cursor is advanced.
@@ -485,10 +488,13 @@ impl Runtime {
packet.finish(Err(EINVAL));
continue;
};
- let result = (|| -> Result<(mmu::VmBind, event::EventValue)> {
+ let slot = state.next_slot;
+ let stamp = state.last.next();
+ let ordinal = state.published + 1;
+ let last = index + 1 == packet.commands.len();
+ let result = (|| -> Result {
let bind = self.graph.kernel_uat().bind(&packet.vm)?;
let preempt = packet.preempt.as_ref().ok_or(EINVAL)?.gpu_va().get();
- let stamp = state.last.next();
let job = ComputeJob {
context: bind.slot(),
sequence: state.sequence,
@@ -497,35 +503,33 @@ impl Runtime {
usc_base: control.usc_base,
preempt,
};
- let command = state.pool.encode(state.next_slot, &state.queue, stamp.raw(), &job)?;
+ let command = state.pool.encode(slot, &state.queue, stamp.raw(), &job)?;
+ let publication = state.root.stage_compute(command)?;
+ state.inflight.push(Inflight { packet: packet.clone(), last, stamp, slot, ordinal,
+ started: Instant::now(), _bind: bind }, GFP_KERNEL)?;
packet.mark_published();
- state.root.publish(command)?;
- state.peer.as_mut().send_message(EP_DOORBELL, gpu::COMPUTE_KICK)?;
- Ok((bind, stamp))
+ publication.commit();
+ Ok(())
})();
match result {
- Ok((bind, stamp)) => {
+ Ok(()) => {
state.last = stamp;
state.sequence += 1;
- let slot = state.next_slot;
state.busy |= 1 << slot;
- state.published += 1;
- let ordinal = state.published;
- state.next_slot = (state.next_slot + 1) % POOL_SLOTS;
+ state.published = ordinal;
+ state.next_slot = (slot + 1) % POOL_SLOTS;
state.submitted += 1;
- let last = index + 1 == packet.commands.len();
- if state.inflight.push(Inflight { packet: packet.clone(), last, stamp, slot, ordinal,
- started: Instant::now(), _bind: bind }, GFP_KERNEL).is_err() {
- self.fail_all(state, ENOMEM);
+ if last { let _ = state.pending.remove(0); } else { state.pending[0].1 += 1; }
+ if let Err(err) = state.peer.as_mut().send_message(EP_DOORBELL, gpu::COMPUTE_KICK) {
+ self.fail_all(state, err);
return;
}
- if last { let _ = state.pending.remove(0); } else { state.pending[0].1 += 1; }
}
+ Err(EBUSY) if !state.inflight.is_empty() => return,
Err(e) => {
dev_err!(self.dev, "GPU: compute publication failed {:?}\n", e);
let _ = state.pending.remove(0);
- // Earlier commands of a published packet fail it when they retire.
- if !(packet.may_be_published() && index != 0) {
+ if !state.inflight.iter().any(|flight| Arc::ptr_eq(&flight.packet, &packet)) {
packet.release_guard();
}
packet.finish(Err(e));
@@ -594,6 +598,10 @@ impl Runtime {
state.retired += 1;
if done.last {
done.packet.retired();
+ } else if !state.inflight.iter().any(|flight| Arc::ptr_eq(&flight.packet, &done.packet))
+ && !state.pending.iter().any(|(packet, _)| Arc::ptr_eq(packet, &done.packet))
+ {
+ done.packet.release_guard();
}
}
continue;
diff --git a/drivers/gpu/drm/asahi/gpu/v27_2.rs b/drivers/gpu/drm/asahi/gpu/v27_2.rs
index 8db6c0ded49fd..e4692492ff8b4 100644
--- a/drivers/gpu/drm/asahi/gpu/v27_2.rs
+++ b/drivers/gpu/drm/asahi/gpu/v27_2.rs
@@ -358,6 +358,27 @@ impl CommandPool {
}
}
+/// Ring contents prepared while the firmware still owns the old producer.
+pub(crate) struct ComputePublication<'a> {
+ positions: &'a fw::types::GpuArray<u8>,
+ indices: &'a fw::types::GpuArray<u8>,
+ head: &'a core::sync::atomic::AtomicU32,
+ producer: &'a core::sync::atomic::AtomicU32,
+ next_head: u32,
+ next_producer: u32,
+}
+
+impl ComputePublication<'_> {
+ pub(crate) fn commit(self) {
+ self.head.store(self.next_head, Ordering::Release);
+ crate::pgtable::clean_poc(self.positions.as_slice().as_ptr(), 0x60);
+ crate::pgtable::poc_barrier();
+ self.producer.store(self.next_producer, Ordering::Release);
+ crate::pgtable::clean_poc(self.indices.as_slice().as_ptr(), 0x30);
+ crate::pgtable::poc_barrier();
+ }
+}
+
/// The firmware 27.2 root and every record it names.
pub(crate) struct RootV27_2 {
graph: Arc<GpuManagerG14V13_5>,
@@ -410,42 +431,50 @@ impl RootV27_2 {
Ok((Self::word(&self.boot.positions, 0x40)?, Self::word(&self.boot.positions, 0)?))
}
- /// Publishes `command` as the queue's next command: pointer, queue head, then the compute
- /// submission entry and its producer.
- pub(crate) fn publish(&self, command: u64) -> Result {
+ /// Prepares a work pointer and channel entry without advancing either producer.
+ pub(crate) fn stage_compute(&self, command: u64) -> Result<ComputePublication<'_>> {
let job = &self.boot;
+ let indices = &self.channels[2 * SUBMISSION_RING];
+ let ring = &self.channels[2 * SUBMISSION_RING + 1];
+ crate::pgtable::clean_invalidate_poc(job.positions.as_slice().as_ptr(), 0x60);
+ crate::pgtable::clean_invalidate_poc(indices.as_slice().as_ptr(), 0x30);
+ crate::pgtable::poc_barrier();
let head = job.positions.shared_index(0x40)?;
let old = head.load(Ordering::Acquire);
let capacity = Self::word(&job.positions, 0x50)?;
- if capacity == 0 || (old % capacity) as usize * 8 + 8 > job.pointers.as_slice().len() {
- return Err(EINVAL);
+ let retired = Self::word(&job.positions, 0)?;
+ if capacity <= 1 || old >= capacity || retired >= capacity
+ || capacity as usize > job.pointers.len() / 8
+ {
+ return Err(EIO);
}
- let at = (old % capacity) as usize * 8;
+ let next_head = (old + 1) % capacity;
+ if next_head == retired { return Err(EBUSY); }
+
+ let producer = indices.shared_index(0x20)?;
+ let write = producer.load(Ordering::Acquire);
+ let read = Self::word(indices, 0)?;
+ let entries = crate::m3::m3_channel_format::SLOTS;
+ if write >= entries || read >= entries { return Err(EIO); }
+ let next_producer = (write + 1) % entries;
+ if next_producer == read { return Err(EBUSY); }
+ let slot = u8::try_from(job.event.slot()).map_err(|_| EINVAL)?;
+ let entry = crate::m3::submission_entry(COMPUTE as u32, job.queue.gpu_va().get(),
+ u16::try_from(next_head).map_err(|_| EINVAL)?, slot, false).map_err(|_| EINVAL)?;
+
+ let at = old as usize * 8;
job.pointers.shared_index(at)?.store(command as u32, Ordering::Relaxed);
job.pointers.shared_index(at + 4)?.store((command >> 32) as u32, Ordering::Relaxed);
crate::pgtable::clean_poc(job.pointers.as_slice()[at..].as_ptr(), 8);
- crate::pgtable::poc_barrier();
- let new = (old + 1) % capacity;
- head.store(new, Ordering::Release);
- crate::pgtable::clean_poc(job.positions.as_slice().as_ptr(), 0x60);
- crate::pgtable::poc_barrier();
- let state = &self.channels[2 * SUBMISSION_RING];
- let ring = &self.channels[2 * SUBMISSION_RING + 1];
- let w = Self::word(state, 0x20)?;
- if w >= crate::m3::m3_channel_format::SLOTS { return Err(EIO); }
- let slot = u8::try_from(job.event.slot()).map_err(|_| EINVAL)?;
- let entry = crate::m3::submission_entry(COMPUTE as u32, job.queue.gpu_va().get(),
- u16::try_from(new).map_err(|_| EINVAL)?, slot, false).map_err(|_| EINVAL)?;
- let base = w as usize * entry.len();
- for (k, word) in entry.chunks(4).enumerate() {
- ring.shared_index(base + 4 * k)?.store(u32::from_le_bytes([word[0], word[1], word[2], word[3]]), Ordering::Relaxed);
+ let base = write as usize * entry.len();
+ for (index, word) in entry.chunks_exact(4).enumerate() {
+ ring.shared_index(base + 4 * index)?.store(
+ u32::from_le_bytes([word[0], word[1], word[2], word[3]]), Ordering::Relaxed);
}
crate::pgtable::clean_poc(ring.as_slice()[base..].as_ptr(), entry.len());
crate::pgtable::poc_barrier();
- state.shared_index(0x20)?.store((w + 1) % crate::m3::m3_channel_format::SLOTS, Ordering::Release);
- crate::pgtable::clean_poc(state.as_slice().as_ptr(), 0x30);
- crate::pgtable::poc_barrier();
- Ok(())
+ Ok(ComputePublication { positions: &job.positions, indices, head, producer,
+ next_head, next_producer })
}
/// Publishes the boot job, whose command and ring entry the root already holds. The GPU
--
2.54.0
From 027f0b26de789e05f4ea094f559afbbdcd0ee7b5 Mon Sep 17 00:00:00 2001
From: Ryan Murray <ryan@aurorasilicon.org>
Date: Mon, 23 Nov 2026 23:32:43 +1100
Subject: [PATCH 2/3] drm/asahi: drain G14 submissions before completing or
stopping
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>
---
drivers/gpu/drm/asahi/g14_v27_2.rs | 43 +++++++++++++++++++++---------
1 file changed, 31 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/asahi/g14_v27_2.rs b/drivers/gpu/drm/asahi/g14_v27_2.rs
index 9e6697eda1d2e..682a23f0c96e2 100644
--- a/drivers/gpu/drm/asahi/g14_v27_2.rs
+++ b/drivers/gpu/drm/asahi/g14_v27_2.rs
@@ -299,6 +299,7 @@ pub(crate) fn start<'a>(pdev: &'a platform::Device<device::Core<'_>>, cfg: &'sta
struct Inflight {
packet: Arc<Packet>,
last: bool,
+ publication_error: Option<Error>,
stamp: event::EventValue,
slot: usize,
/// Queue publications up to and including this command, counted from take-over.
@@ -335,10 +336,26 @@ struct State {
capacity: u32,
inflight: KVec<Inflight>,
pending: KVec<(Arc<Packet>, usize)>,
+ accepting: bool,
submitted: u64,
retired: u64,
}
+impl State {
+ /// Stop publishing this packet. Report failure only once any published prefix retires.
+ fn fail_publication(&mut self, packet: &Arc<Packet>, err: Error) {
+ let _ = self.pending.remove(0);
+ if let Some(last) = self.inflight.iter_mut().rev()
+ .find(|flight| Arc::ptr_eq(&flight.packet, packet))
+ {
+ last.publication_error = Some(err);
+ } else {
+ packet.release_guard();
+ packet.finish(Err(err));
+ }
+ }
+}
+
#[pin_data(PinnedDrop)]
pub(crate) struct Runtime {
dev: ARef<device::Device>,
@@ -396,6 +413,7 @@ impl Runtime {
let mut guard = self.state.lock();
let state = Option::as_mut(&mut *guard).ok_or(ENODEV)?;
if !self.healthy() { return Err(EIO); }
+ if !state.accepting { return Err(ENODEV); }
state.pending.push((packet, 0), GFP_KERNEL)?;
self.pump(state);
Ok(())
@@ -483,9 +501,7 @@ impl Runtime {
let (packet, index) = (state.pending[0].0.clone(), state.pending[0].1);
let Command::Compute(control) = packet.commands[index] else {
// Queues of this backend accept only compute commands (Queue::submit).
- let _ = state.pending.remove(0);
- if !(packet.may_be_published() && index != 0) { packet.release_guard(); }
- packet.finish(Err(EINVAL));
+ state.fail_publication(&packet, EINVAL);
continue;
};
let slot = state.next_slot;
@@ -506,7 +522,7 @@ impl Runtime {
let command = state.pool.encode(slot, &state.queue, stamp.raw(), &job)?;
let publication = state.root.stage_compute(command)?;
state.inflight.push(Inflight { packet: packet.clone(), last, stamp, slot, ordinal,
- started: Instant::now(), _bind: bind }, GFP_KERNEL)?;
+ publication_error: None, started: Instant::now(), _bind: bind }, GFP_KERNEL)?;
packet.mark_published();
publication.commit();
Ok(())
@@ -528,11 +544,7 @@ impl Runtime {
Err(EBUSY) if !state.inflight.is_empty() => return,
Err(e) => {
dev_err!(self.dev, "GPU: compute publication failed {:?}\n", e);
- let _ = state.pending.remove(0);
- if !state.inflight.iter().any(|flight| Arc::ptr_eq(&flight.packet, &packet)) {
- packet.release_guard();
- }
- packet.finish(Err(e));
+ state.fail_publication(&packet, e);
}
}
}
@@ -596,7 +608,10 @@ impl Runtime {
}
state.busy &= !(1 << done.slot);
state.retired += 1;
- if done.last {
+ if let Some(err) = done.publication_error {
+ done.packet.release_guard();
+ done.packet.finish(Err(err));
+ } else if done.last {
done.packet.retired();
} else if !state.inflight.iter().any(|flight| Arc::ptr_eq(&flight.packet, &done.packet))
&& !state.pending.iter().any(|(packet, _)| Arc::ptr_eq(packet, &done.packet))
@@ -666,17 +681,20 @@ impl Runtime {
/// Stops the firmware: retire or fail outstanding work, allow power-off, then halt the ASC
/// with every mapping still in place (RTKit power-off if the firmware does not stop).
pub(crate) fn stop(&self) {
- // Let published work retire; the service signals `idle` when nothing is left.
+ // Close admission while the service retires work already accepted.
{
let mut guard = self.state.lock();
+ let Some(state) = Option::as_mut(&mut *guard) else { return; };
+ state.accepting = false;
let start = Instant::<Monotonic>::now();
while self.healthy() && start.elapsed() < Delta::from_millis(STOP_DRAIN_MS.into()) {
let Some(state) = guard.as_ref() else { break; };
if state.inflight.is_empty() && state.pending.is_empty() { break; }
let _ = self.idle.wait_timeout(&mut guard, msecs_to_jiffies(STOP_DRAIN_MS));
}
+ // Serialize the last permitted publication with the transition to shutdown.
+ self.healthy.store(false, Ordering::Release);
}
- self.healthy.store(false, Ordering::Release);
// Nothing queues service work after the detach, and none is queued or running once the
// drain returns, so no work outlives the module.
drop(self.notify.detach());
@@ -790,6 +808,7 @@ impl Backend {
capacity,
inflight: KVec::new(),
pending: KVec::new(),
+ accepting: true,
submitted: 0,
retired: 0,
});
--
2.54.0
From 6f67df239dd57bc0bf8e24c631c75c4d714ee4bf Mon Sep 17 00:00:00 2001
From: Ryan Murray <ryan@aurorasilicon.org>
Date: Mon, 23 Nov 2026 23:32:43 +1100
Subject: [PATCH 3/3] drm/asahi: require the firmware handoff SRAM voltage
table
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>
---
drivers/gpu/drm/asahi/gpu/v27_2.rs | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/asahi/gpu/v27_2.rs b/drivers/gpu/drm/asahi/gpu/v27_2.rs
index e4692492ff8b4..37d09ac8a19be 100644
--- a/drivers/gpu/drm/asahi/gpu/v27_2.rs
+++ b/drivers/gpu/drm/asahi/gpu/v27_2.rs
@@ -758,18 +758,11 @@ impl RootV27_2 {
}
for (i, state) in states.iter().enumerate() {
let [mv] = state.volt_mv.as_slice() else { return Err(EINVAL); };
- let sram_mv = match &sram_table {
- Some(table) => {
- let (freq, voltage) = table[i * 8..i * 8 + 8].split_at(4);
- if u32::from_le_bytes(freq.try_into().map_err(|_| EINVAL)?) != state.freq_hz {
- return Err(EINVAL);
- }
- let value = u32::from_le_bytes(voltage.try_into().map_err(|_| EINVAL)?);
- if value < *mv || value > 1100 { return Err(EINVAL); }
- value
- }
- None => (*mv).max(850),
- };
+ let (freq, voltage) = sram_table[i * 8..i * 8 + 8].split_at(4);
+ let sram_mv = u32::from_le_bytes(voltage.try_into().map_err(|_| EINVAL)?);
+ if u32::from_le_bytes(freq.try_into().map_err(|_| EINVAL)?) != state.freq_hz || sram_mv < *mv || sram_mv == 0 {
+ return Err(EINVAL);
+ }
let mhz = state.freq_hz / 1_000_000;
for series in [abi::COMMON26_HW_PERF_FREQUENCY, 0x1924] {
put32(hw, series + i * 4, mhz);
@@ -911,8 +904,8 @@ impl RootV27_2 {
}
/// The loader's `adt-perf-states-sram` table under `/chosen/aurora-gpu-resources/sgx`
- /// (frequency and SRAM millivolts per state), if it published one. The node itself must exist.
- fn sram_table(states: usize) -> Result<Option<KVec<u8>>> {
+ /// (frequency and SRAM millivolts per state).
+ fn sram_table(states: usize) -> Result<KVec<u8>> {
let chosen = kernel::of::chosen().ok_or(ENODEV)?;
let is = |name: Option<KVec<u8>>, want: &[u8]| {
name.as_deref().is_some_and(|n| n.strip_suffix(b"\0").unwrap_or(n) == want)
@@ -921,8 +914,9 @@ impl RootV27_2 {
if !is(parent.get_opt_property::<KVec<u8>>(c"name")?, b"aurora-gpu-resources") { continue; }
for child in parent.children() {
if is(child.get_opt_property::<KVec<u8>>(c"name")?, b"sgx") {
- let table = child.get_opt_property::<KVec<u8>>(c"adt-perf-states-sram")?;
- if table.as_ref().is_some_and(|t| t.len() != states * 8) { return Err(EINVAL); }
+ let table = child.get_opt_property::<KVec<u8>>(c"adt-perf-states-sram")?
+ .ok_or(ENODEV)?;
+ if table.len() != states * 8 { return Err(EINVAL); }
return Ok(table);
}
}
--
2.54.0
Assisted-by: LLM (Codex) |
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>
|
The review fixes are available in #2979, stacked on The new selector and suspend fixtures passed 4/4 native and 4/4 in AArch64 QEMU. The port through the G14 Kconfig to the J473 trial base ( |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal adversarial pre-PR checklist re-review (§1–§6) at 4c4f313592fa57186dba793752de61c1b41edda0.
Stack & Superseded Status
- Not superseded on
integration/aurora(g14_v27_2.rsis not present onintegration/aurora). - Stack order:
#2543(satchlj/g14-v27-2-shared, still open with activeREQUEST_CHANGES) ->#2544->#2545->#2610. - Rebase onto
#2543(119cce51da9f) cleanly dropped the prior merge commit; all 4 commits (96c882e9,a47acf0b,660936a3,4c4f3135) pass §4 DCO hygiene. However, the source tree of the G14 27.2 implementation is unchanged fromf5dfd2617395, so all four prior blockers remain open on4c4f313592fa(note: follow-up fixes exist in draft#2979but are not yet folded into this PR).
Unresolved Blockers on 4c4f313592fa
- §3 Safety — hardcoded SRAM voltage fallback and bare thermal/alarm literals (
drivers/gpu/drm/asahi/gpu/v27_2.rs):sram_table()still returnsResult<Option<KVec<u8>>>andRootV27_2::build()still falls back toNone => (*mv).max(850)(with a hardcoded> 1100ceiling) instead of failing closed whenadt-perf-states-sramis absent.RootV27_2::controller()still writes bare literals(0x22d4, 11000),(0x2284, 900),(0x2f30, 125), andcrate::f32!(5.3)instead of sourcing limits/coefficients fromHwConfig/ DT / ADT.
- §2 Concurrency bug —
Runtime::submit()vsRuntime::stop()race (drivers/gpu/drm/asahi/g14_v27_2.rs):Runtime::submit()still checksif !self.healthy()before acquiringself.state.lock(),pump()does not checkself.healthy(), andstop()does not close submission admission underself.state.lock()prior to draining/halting.
- §2 Post-publish
ENOMEMVmBinddrop, partial multi-commandVmJobGuardbug, and unstaged ring publication (g14_v27_2.rs,gpu/v27_2.rs):pump()still callsstate.root.publish(command)?andsend_message(EP_DOORBELL, COMPUTE_KICK)?beforestate.inflight.push(...)— anENOMEMonpush(or doorbell error after producer advance) dropsVmBindwhile the firmware owns the published command.- On failure of a non-first command in a multi-command
Packet,pump()skipsrelease_guard()and immediately callspacket.finish(Err(e))while command 0 is still executing; when command 0 retires (done.last == false),release_guard()is never called. RootV27_2::publish()advances queueheadbefore verifying submission-ring space (next_head == retired/next_producer == read) or encodingsubmission_entry.- Folding the staged-publication / admission-gate / required-SRAM fixes (drafted in
#2979) into this PR will close Blockers #1 (SRAM part), #2, and #3.
- §1 Chip-ID & firmware-version gating (
drivers/gpu/drm/asahi/g14_v27_2.rs,driver.rs):g14_v27_2::start()still matches literalcfg.chip_id { 0x8112 => ... }instead of carrying the 27.2 register table/mask viaHwConfig/ hardware description.driver.rsstill gates on exactapple,firmware-version == &[27, 2, 0]without a §1 justification or loader capability contract (e.g.apple,firmware-compat).
- Blocked parent PR (
#2543) & §5 Evidence:- Parent
#2543has openREQUEST_CHANGES;host-testshas not run againstintegration/aurora(thoughsource,rust-build,kunit, and DWC3/ATC 3/3 passed on4c4f313592fa). - Also note the J473 (second G14G machine) findings in thread:
STATE_CAP = 100pins P1 and missingStartCompute.unk_28 = 1/ temperature-alarm floor caused deterministic hangs onclpeakint8 dot-product anddEQP-VK.compute.pipeline.zero_initialize_workgroup_memory.max_workgroup_memory.1(fix patch shared in comments). - Still needed on the fixed head: exact-head
rmmodafter s2idle, §5 regression gate counts (0 SELinux denials / 0 failed units / 0 new kernel errors), and a G13/G14 13.5-stub no-regression boot row.
- Parent
Checklist Summary (§1–§6)
- §1 No model gating: Blocked (Blocker #4).
- §2 Production-ready, no hacks: Blocked (Blockers #2, #3; also
sleep_prepare()still polls every 50 ms onidle.wait_timeout). - §3 Safety: Blocked (Blocker #1).
- §4 Clean-room & attribution: Pass (all 4 commits carry human author/committer and human
Signed-off-by:only, 0 AI commit trailers; PR body includesAssisted-by:). - §5 Evidence: Incomplete (
host-testsnot run on integration base; exact-head post-fix s2idle+unbind, regression gate counts, and 13.5-stub no-regression row still needed). - §6 Naming: Pass.
Assisted-by: LLM (Gemini 4 Neon)
bind_inner() cleaned the TTBAT slot directly when UatInner::clean_poc was set without quirks.clean_tables, leaving VmInner::drop() — which clears ttb0/ttb1 and calls only UatShared::publish_slot() — without a cache clean on adopted non-snooping UATs. If the walker later reads the cleared slot before the cache line is evicted, it can still see the stale root after the VM's page tables are freed. Mirror clean_poc onto UatShared (true in new_adopted_inner, matching quirks.clean_tables in make_inner), check self.clean_poc || self.quirks.clean_tables in UatShared::publish_slot(), and drop the bind-only duplicate in bind_inner(). Extend the asahi-m4 retention host harness to assert that both bind() and VmInner::drop() write back the TTBAT slot once when clean_poc or clean_tables is set and not at all for a coherent walker. Signed-off-by: Satya Benson <satya@benson.earth>
|
MERGETRAIN6 source review at The relevant ownership, staging and SRAM-table changes are in the follow-up drafts #2979 and #3031. Please bring one version into this branch before enabling it and carry the required machine-supplied thermal policy with it. The running m2pub1 trial contains this commit and the later render fixes together. Its row can describe that combined tree. Assisted-by: LLM (Codex) |
|
Gemini 4 Neon on @satchlj's behalf: reviewed
No branch updates, builds, or J413/J473 hardware tests have been run yet pending alignment on those two points. |
|
Yes. Please carry the four signed commits from #2979 onto the compute base with a normal push. Bring in the current #2543 teardown fix first. That gives #2545 and #2610 a safe base. The render branch should keep only its render-specific ownership changes on top. For the thermal handoff, the merged producer in aurora-silicon/aura#448 is the starting point. It passes the ADT I have no verified machine source yet for every alarm threshold or sensor correction used by the G14 controller. Treat the ADT alarm property as a lead and confirm its scope and units before mapping it. Missing or malformed required protection inputs should stop this firmware start and leave the GPU disabled. Keep the previously qualified performance ceiling until the sourced policy is exercised on J473 and the fanless J413. Assisted-by: LLM (Codex) |
|
On the
The options as I see them:
I lean towards (B) for the existing values, keeping 5.3 as the open item, but this is a policy call for Dj and Ryan. Assisted-by: LLM (Claude:Opus 5.5) |
Signed-off-by: Satya Benson <satya@benson.earth>
|
Codex GPT-6.2 Astra on @satchlj's behalf: Compute advanced by normal fast-forward. The shared and compute branches diverged at 119cce5. The merge takes the fixed shared head 152822e as first parent and Ryan’s 9111ff5 as second parent, preserving all four original commit objects and sign-offs. 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 db645f40085205cc63286b9eaee5392026d191aa (OPEN, non-draft, MERGEABLE, base satchlj/g14-v27-2-shared).
Live CI & Commit Hygiene (§4)
- CI (6/6 PASS on
db645f400852):source,rust-build,kunit,DWC3/ATC builtin-no-atc,DWC3/ATC modular-no-atc, andDWC3/ATC builtin-modular-atcall succeeded (host-testswill run once retargeted tointegration/aurora). - §4 Hygiene (PASS): Compares 9 commits ahead of
satchlj/g14-v27-2-shared(152822e24034). All commits carry human author/committer (Satya BensonorRyan Murray) with matching humanSigned-off-by:and zero AI commit trailers, with no duplicate commits. Fast-forward mergedb645f400852(parents: 152822e24034, 9111ff5b8874, signed by Satya Benson) preserves Ryan Murray’s 4 original signed commit objects from merged #2979 unchanged alongside #2543’s PoC clean (152822e24034).
Prior Blockers Verified Cleared
All four code/safety/gating blockers from 4c4f313592fa plus #2543’s teardown PoC clean are cleanly present on db645f400852:
- SRAM voltage floor/cap (
6f67df239dd5,drivers/gpu/drm/asahi/gpu/v27_2.rs:617, 759-765, 908-925):sram_table()now returnsResult<KVec<u8>>(ENODEVifadt-perf-states-sramis absent,EINVALon length mismatch/missing node) andRootV27_2::build()validatesfreq == state.freq_hz,sram_mv >= *mv, andsram_mv != 0. The hardcoded(*mv).max(850)fallback and> 1100cap are gone. submit()/stop()race (027f0b26de78,drivers/gpu/drm/asahi/g14_v27_2.rs:408-420, 469-471, 691-708):stop()setsstate.accepting = falseunderself.state.lock()before draining and markshealthy = falseunder the lock after drain;submit()re-checks bothself.healthy()andstate.acceptingunderself.state.lock();pump()checksself.healthy()at entry.VmBind, staged publication,VmJobGuard, and 50 ms suspend poll (27d1f77bb267,027f0b26de78,9111ff5b8874,gpu/v27_2.rs:435-478,g14_v27_2.rs:352-362, 511-550, 569-573, 615-631, 654-673):stage_compute()validates both ring spaces, encodes and PoC-cleans both entries before returningComputePublication;pump()bindsVmBindand pushesInflightbeforemark_published()+publication.commit();fail_publication()retainsVmJobGuarduntil any published prefix retires (publication_error);sleep_prepare()replaces the 50 ms poll with a remaining-jiffiesCondVar::wait_timeoutwoken wheninflight.is_empty()whileasleep.- Chip-ID & firmware-version gate (
9111ff5b8874,driver.rs:156, 204, 380-409, 503-511,g14_v27_2.rs:214-223):driver.rsselects viaProbeConfig::LegacyWithG14Handoff+ DTapple,firmware-compat == [27, 2, 0]and passeshw::t8112::REGISTERS_V27_2/WRITABLE_V27_2directly, removingmatch cfg.chip_id { 0x8112 => ... }and the exactapple,firmware-versiongate. - #2543
152822e24034PoC clean (mmu.rs:2054, 2084-2092, 3637, 4247,test-mmu-retention.py): Present via first parent152822e24034(UatShared::clean_pocinpublish_slot()).
Remaining Blockers
- §3 Safety — hardcoded thermal/alarm literals in
RootV27_2::controller()(drivers/gpu/drm/asahi/gpu/v27_2.rs:953-962) awaiting theaura#402DT property contract / policy resolution:- Already consumed from
PwrConfig/ 13.5hwdata_a:max_state(perf_states),perf_base_pstate,pwr_sample_period_aic_clks,pwr_min_duty_cycle,perf_integral_gain/2,perf_proportional_gain/2,max_freq_mhz,ppm_filter_time_constant_ms / power_sample_period, plushwdata_aPPM/avg-power/perf/SE fields andfast_die0_release_temp_cc(note: defaults to 80 when absent in DT),fast_die0_sensor_mask(fromhw/t8112.rs),fast_die0_ki_dt, andfast_die0_kp. (PwrConfigalso carriesfast_die0_prop_tgt_delta, which alone does not establish an absolute target.) - Exact literals still present in
controller()(gpu/v27_2.rs:954-961):0x22d4 = 11000(fast-die target in centi-°C; matcheshw/t8112.rsHwConfigA::unk_8cc)0x2284 = 900(matcheshw/t8112.rsHwConfigA::unk_87c)0x2288 = 4and0x229c = crate::f32!(1.0)(controller constants also literal in 13.5initdata.rsand G15g15/board/record.rs)0x2f30 = 125and0x2f34 = 1(SoC-hot alarm threshold and enable; matchesHwConfigA::unk_e24/ G15)0x2320,0x2420,0x2f38,0x3038per-sensorcrate::f32!(5.3)corrections for every set bit insensors(no 13.5/G15 equivalent and no verified ADT source yet)
- These remain blocked pending the locked
aura#402DT property contract and maintainer decision on Option A (strict fail-closed) vs Option B (shared chip-config constants + ADT overrides, keeping5.3open until sourced).
- Already consumed from
- Stacked parent (#2543) & §5 Evidence on final head:
- Parent #2543 (
152822e24034) is still open with activeCHANGES_REQUESTED; retarget tointegration/auroraonce #2543 lands sohost-testsruns on the final base. - Only the Rust MMU retention harness + 119 host tests have been run on
db645f400852so far. Before merge, record exact-head J413 + J473 hardware validation (including s2idle +rmmodunbind), §5 regression gate counts (0 SELinux denials / 0 failed units / 0 new kernel errors), and a 13.5-stub G13/G14 no-regression boot row.
- Parent #2543 (
Checklist Summary (§1–§6)
- §1 No model gating: Pass (chip-ID and exact firmware-version gates cleared).
- §2 Production-ready, no hacks: Pass (all concurrency, staging,
VmBind/VmJobGuard, and 50 ms poll blockers cleared). - §3 Safety: Blocked (SRAM fallback cleared;
controller()thermal/alarm literals and per-sensor5.3corrections remain open pendingaura#402contract / policy decision). - §4 Clean-room & attribution: Pass.
- §5 Evidence: Incomplete (6/6 stacked CI checks pass; exact-head hardware/s2idle+unbind/regression-gate/13.5-stub rows and
host-testsonintegration/aurorapending). - §6 Naming: Pass.
Assisted-by: LLM (Gemini 4 Neon)
|
The thermal input contract for G14G firmware 27.2, which aura#402 asked for (Dj's §3). In short: apply what the merged T8122 path does, with no new properties and no literals in the runtime code. One value (5.3) has no source and needs a decision. The J473's 27.2 ADT carries no GPU thermal limits. ContractWhat the machine provides (J473, /arm-io/sgx)
What the merged T8122 path does (aura#448 + kernel m3/hw/t8122.rs)aura#448 publishes apple,fast-die0-target from the ADT (88 on the J613), but no kernel code reads it. Contract
Proposed #2544 change (owner: Satya, or us if he hands it over)Replace Assisted-by: LLM (Claude:Opus 5.5) |
|
Correction to the contract above: its line "Already machine-sourced, unchanged: fast-die release temperature, sensor mask and PI gains" is wrong for the J473. Only the PI gains (and the ppm gains and max power) come from the ADT. The fast-die sensor mask comes from Assisted-by: LLM (Claude:Opus 5.5) |
Claude Opus 5.5 on @satchlj's behalf.
Second of three PRs that replace #2473: the compute backend as the G14 firmware-27.2 path. It builds on #2543. #2545 removes its build dependency on
CONFIG_DRM_ASAHI_M3_T8122.Selection. A G14G GPU (
apple,agx-t8112, the existing T8112 configuration) whose DTapple,firmware-versionis 27.2.0 takes this path inprobe, before anything starts the coprocessor. There is no board name and no extra compatible. Other firmware versions keep the existing code.What changes
fw/initdata.rs,rust/macros/versions.rs: rawInitDataandHwDataBgain aV27_2layout. A newAGX_V27_2version group instantiates only those two types for G14/V27_2. Compile-time checks pin the 27.2 offsets against 13.5.GpuManagerand the other versioned types are unchanged.gpu/v27_2.rs: the 27.2 root. It is built on the records of a 13.5 G14 manager (GpuManager::build_graphwithGraphProfile::G14V27_2: no register mappings, and the private range stays below the 27.2 timestamp aperture). It holds the hardware data from the 13.5 values, the chip's 27.2 register table (hw/t8112.rs), the power and thermal controller, the two idle-policy records, and one queue with a kernel-owned boot compute job. The firmware never sees the 13.5 root.g14_v27_2.rs: start sequence, runtime and DRM backend. It mirrors the kernel window into the loader's shared second-level table and names it in TTBAT context 0 (mmu::FirmwareWindow). It then starts the ASC, sends the root, holds the GPU powered and retires the boot job. Clients submit through the 26.x front end (m3_submit). Each compute command is encoded in the 27.2 layout from a 48-slot pool and published in order on the root's queue. The runtime runs from the firmware's endpoint-0x20 messages, which it sends after publishing event, statistics or log records: each one queues a run of the service, which consumes the event, statistics, log and trace rings (the firmware waits when one is full) and retires completed commands. Completion follows the queue's retired position, which the firmware advances in order. There is no poll or timer; the DRM scheduler's job timeout runs the service as the backstop for a hung command. Each command goes into the next of 48 pool slots that is neither in flight nor still held by the firmware (tracking +0x94). The scheduler has one run queue per priority. Render commands getEINVAL. Unbind lets published work retire, detaches the message route, drains the service's workqueue, then stops the firmware (allow-off, RTKit power-off if it is still running, ASC halt) and keeps its memory for the rest of the boot.CrashLog::from_firmware,GpuArray::shared_index,EventManager::try_get_polled, the Fender operating-point read,rtkit_dump.c(crash log to devcoredump), and the G14 skip of the 26.x CDM launch check, which decodes the G15 launch format.Against #2473
apple,coredump-copy-buffer, the UAT regions, the loader's per-state SRAM voltages under/chosen/aurora-gpu-resources/sgx), from the GPU's ID registers (core mask and count), and from the T8112 configuration (sensor masks, leakage table, preemption size, the 27.2 register table).t8112_dashboard_real=1overrodet8112_dashboard_ram=1, so slot 9 was always the real push-telemetry page mapped read-write, and the hand-saved snapshot was never read. The drm/asahi: T8112 G14G GPU on firmware 27.2: compute DRM device #2473 trial logs show slot 9 at 0x23b3d0000, RW. This PR deletes the RAM substitute and its seed files; nothing replaces them.mmu.rs.mmu.rskeeps onlyFirmwareWindow: map the loader regions, mirror, install, announce.Tested, this head (
f890a9c9, slot-cursor fix) on phellos (J413, firmware 27.2), the up3 default kernel (7.3.0-1-up3-ARCH), this branch's module built against it (through #2545), loaded with no parameters under the same watchdog arrangement, trials h1–h8: 8/8 PASS. Each ran 3 × 1024 and 300 × 4096 words, every word checked, 303 of 303 dispatches; "GPU stopped: allow-off=Ok(()) running=Ok(0) forced-off=None submitted=303 completed=303 notifications=307 late=0 skipped-slots=0 deferred-cursors=45…48"; cleanrmmod; unattended return. Cause and bisect are in the PR comment of 2026-11-20.Tested, previous head (
9454ef44, review rework) on phellos, J413 with firmware 27.2, the up2 default kernel (integration/aurora458f759 + open PRs; this module built from the #2545 head over it), loaded with no parameters under the same watchdog arrangement, trial d8: PASS (later, on the up3 kernel, this head passed only 2 of 7 boots: the pool-slot cursor race fixed by f890a9c), 3 × 1024 and 300 × 4096 words, every word checked, 303 of 303 dispatches; "GPU stopped: allow-off=Ok(()) running=Ok(0) forced-off=None submitted=303 completed=303 notifications=307 late=0 skipped-slots=11945"; cleanrmmod; unattended return to the default. The 300 dispatches took 77 ms (6.3 s with the old 20 ms idle poll). Start takes about 5 ms instead of 1.5 s.Tested, earlier heads on phellos, a J413 (M2 MacBook Air) with firmware 27.2. The packaged default kernel (
integration/aurora61295c2 + open PRs) loaded this PR's module with no parameters, under a watchdog with unattended return:DRM_ASAHI_G15andDRM_ASAHI_M3_T8122): PASS, 303 of 303 dispatches, 0 bad words; normal stop; cleanrmmod; return to the default;Each trial ran Vulkan compute through Mesa's Borealis driver: 3 × 1024 and 300 × 4096 words,
data[i] = data[i]*mul + add + i, every word checked on the CPU after each dispatch. That is 303 dispatches, past the 256-entry submission ring. Then a normal stop (allow-off acknowledged, firmware reported off, no forced power-off) and a cleanrmmod.The boot loader on those trials was a trial Stage 2 that publishes the GPU on 27.2. Its DTB names the GPU
apple,agx-t8112-identify,apple,agx-t8112; the first compatible is the loader's own trigger. The Aura in phellos's default (main + aura#381) leaves the GPU disabled on 27.2, so this path needs an Aura change before it runs on a default install. That change is not part of this series.Waits that remain. Each is a bounded check of a word the firmware writes and sends no message for: the loader's handoff answer, the ready status (+0x14), the command-handler installation (+0x4c24 cleared), the idle-policy acknowledgement and the running flag at stop (the existing G14 path waits for its device-control channel the same way), and, after a notification, at most 2 ms for the retired position when the completion stamp is already there (never needed in the trials:
late=0). The stop line reports the notifications received, those waits, and how many held slots were passed over.Untested
EBUSY), suspend, and GPU fault recovery.-identifycompatible.Assisted-by: LLM (Anthropic:Claude Opus 5.5)