Skip to content

kboot_gpu: publish the G14G firmware-27.2 handoff for a kernel-started image (T8112 compute) - #402

Merged
RyanTheTide merged 5 commits into
mainfrom
satchlj/t8112-gpu-272-handoff
Nov 24, 2026
Merged

RyanTheTide merged 5 commits into
mainfrom
satchlj/t8112-gpu-272-handoff

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

Update (7eb35d2, Ryan). Two follow-up commits on top of c6faace (no force push):

  • 6223ca5 publishes the handoff by default (no boot-config opt-in).
  • 7eb35d2 marks the GPU power domain apple,no-auto-pm in the transaction that enables the GPU, as t8122_gpu_enable_27() does (the kernel starts this firmware with no PMP link). A GPU node without a single power domain refuses the handoff.

J473 (M2 mini, 27.2) rows with a Stage 2 of aura main + this PR at 7eb35d2, the aurora-silicon/linux#3038 DT and the merge-candidate kernel: GNOME on the GPU, Vulkan CTS depth/stencil set 384/0/248, s2idle 3/3 with the GFX domain retained, live DT shows apple,no-auto-pm + apple,sleep-retained on the GPU domain, 0 failed units, 0 GPU faults (aurora-silicon/linux#3031 (comment)). The J413 Linux install boots 13.5 GPU firmware, which has an initdata layout, so this path is not reached there. The text below describes the earlier heads.

Problem. On macOS 27.2 (26B123) iBoot loads the M2's G14G GPU firmware as three /arm-io/gfx-asc segments (__TEXT;__DATA;__DATA_SHARED_RO, flags <1 0x10 0>), the same shape #393 handles on T8122. Aura has no G14G initdata layout for 27.2, so #381 leaves the GPU disabled. The kernel side, linux#2543 → #2544 → #2545 (g14_v27_2), starts that firmware itself. It needs the loader to publish the handoff: the shared-l2, ttbs, pagetables and handoff regions, apple,firmware-version 27.2.0 and apple,coredump-copy-buffer, and the node set okay.

Change. This routes on the image that is actually loaded, not on the release. This follows Dj's first follow-up on #393.

  • firmware_gfx_version() also identifies images that have no image-info header. It matches the uuid iBoot puts in /arm-io/gfx-asc/iop-gfx-nub together with the __TEXT size. There is one new row, the G14G 27.2 image (EEFD8A47-3273-3387-868A-F1E0585A978E, __TEXT 0x60000). The G14G image has no header at text+0x4200, so the header path cannot name it: a boot without the row logged "no image-info header found".
  • No opt-in (since 6223ca5). The opt-in (chosen.asahi,t8112-gpu=1, dedad0b) is gone: the kernel now renders on this firmware (drm/asahi: render on the G14 firmware-27.2 runtime linux#3031), so the handoff is published whenever firmware_gfx_version() identifies the loaded image. Every fail-closed path below is unchanged. History: the opt-in existed because the compute-only kernel lost the login screen with the GPU bound.
  • When the G13/G14 path has no initdata layout, the image is identified and the opt-in is set, the operating points and leakage are published as before. Then dt_set_gpu_g14g_handoff() runs: kboot_gpu26: publish the T8122 GPU handoff from a three-segment ADT #393's handoff reader and region publication, parameterised by a target (log tag, sgx compatible, GPU node compatible, first-segment VA). For G14G the GPU node is the apple,agx-g14g one, and the segment VAs must run on from the first segment's (0xffffff8000000000 here, where T8122 keeps its fixed 0xfffffc0000000000). In one FDT transaction it:
    • reserves no-map and links ttbs, pagetables, handoff, shared-l2, fw-text and fw-data (__DATA + the read-only tail, checked against the sgx gfx-data-shared-ro pair);
    • publishes apple,firmware-version/-compat from the identified image and apple,coredump-copy-buffer from the nub;
    • publishes /chosen/aurora-gpu-resources/sgx adt-perf-states-sram, the ADT property unchanged, because the kernel's 27.2 backend reads the per-state SRAM voltages from there;
    • sets the GPU node okay.
  • Anything else leaves the GPU disabled as kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381 does, and the boot continues: no opt-in, an unidentified image, a DT without an apple,agx-g14g node, an /arm-io/sgx that is not gpu,t8112, an ADT the reader refuses, a missing perf-states-sram, any failure in the operating-point block on this path (perf-state-count, perf-states lengths, operating-points-v2, the operating-point count, the in-place writes, leakage, calc_power()), or a conflicting reservation. Other chips keep the strict behaviour of that block.

This branch contains #381 (merged in, same commit bcb51d4). Merge #381 first, or take both together.

Where the values come from. Everything published is read from the ADT of the running machine: sgx region pairs, gfx-asc/nub segment lists, the nub uuid and coredump-copy-buffer, and perf-states-sram. The power table is Aura's existing T8112 calculation, unchanged. An earlier local trial loader used a board-specific J413 power model; it is not in this PR.

Testing.

  • Head dedad0b (opt-in and fail-closed; latest main afc8ec1 merged), host only: builds with RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1, the same warning set as main; tests/run-t8122-gpu26-identity.sh and tests/run-t8122-gpu-diagnostics.sh pass; tests/run-kboot-gpu-g15.sh output is identical to main's apart from line numbers (both stop at the existing t8122-25-calibrated fixture failure); pytest tests/python tests/test_t8122_gpu_reader.py tests/test_t8122_gpu_resources.py: 800 passed, 55 skipped. Not booted: no hardware run of this head, with or without the opt-in. No host test was added: this repository's policy prefers E2E tests and rules out unit tests written after the code. The failure modes of this head and how each is to be tested on hardware (phellos, J413 on the 27.2 stub, one-shot Stage 2 under the SoC watchdog, when GPU boots there resume):
    1. No opt-in, identified image → GPU disabled, "needs chosen.asahi,t8112-gpu=1" logged, greeter works. Ryan's hardware row, first boot.
    2. Opt-in, healthy ADT/DT → handoff published, aurora binds, 300 × 4096 compute 3/3. Ryan's row, second part.
    3. Opt-in, s2idle with aurora bound → must resume with no PS gfx error. Ryan's row, last part; expected to fail until linux#2544's s2idle finding is fixed.
    4. Opt-in, OPP table that does not match the ADT (operating-points-v2 missing, wrong OPP count, failed in-place write) → GPU disabled, boot continues. A real J413 DT does not produce this: the same boots, with a DTB whose GPU OPP table has one node removed.
    5. Opt-in, ADT power-state data unusable (perf-state-count/-table-count, perf-states length, calc_power()) → disabled, boot continues. Not reachable on a real J413 ADT without editing it; covered only by code review.
    6. Opt-in, perf-states-sram missing → disabled. Not reachable on phellos (its ADT has it); code review only.
    7. Opt-in, /arm-io/sgx compatible not gpu,t8112 → disabled. On phellos only by building the Stage 2 with a different sgx_compat; the positive case is item 2.
    8. Opt-in, ADT reader refusal or conflicting reservation → disabled (the kboot_gpu26: publish the T8122 GPU handoff from a three-segment ADT #393 reader, unchanged).
  • The hardware rows below are for the earlier head 10373aa, which published the handoff without an opt-in.
  • Host: tests/kboot_gpu_g15_host.c, all 95 scenarios built natively with ASan on arm64 (neo-build). 83 pass on both main 952e0ca and this head; the same 12 stand-in/calibration fixtures fail on both. All 95 outputs (DT, traces, log) are byte-identical between main and this head, so T8122's 26.6.2 and 27.2 handoffs are unchanged. tests/run-t8122-gpu26-identity.sh passes. make format-check with clang-format 20.1.8 is clean. Builds with RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1; no new warnings.
  • Hardware: MacBook Air M2 (J413, T8112) on the 27.2 stub, one-shot aura-try Stage 2 under the SoC watchdog. It is phellos's default Aura (main 29e0d3a + kboot: one AOP firmware-segment path, chosen by the ADT and the DART's range #377, kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381, kboot: publish the firmware-27 DCP clocks from the ADT on the legacy display path #382, kboot/isp: admit macOS 27.2 (26B123) on the M3 Air DCP and the M1/M2/M3 ISP arms with rows #227's isp.c) with this branch merged, plus the kernel's own t8112-j413-fw27.dtb. The kernel is the packaged 7.3.0-1-up3 default (integration/aurora abc61919 + linux#2543–#2545, review-rework heads 949b48bf/9454ef44/7fcd6e20 + other open PRs), with its own in-tree aurora.ko loaded by modprobe aurora, with no parameters.
    • Without the image row: "no image-info header found, GPU firmware not identified", GPU node disabled, the boot otherwise healthy.
    • With it (4 boots): "identified image g14g 27.2 …", GPU node okay, firmware-version <27 2 0>, coredump-copy-buffer 0x8000, memory-region-names … shared-l2 fw-text fw-data. Regions: shared-l2 0x9fff74000+0x4000, fw-text 0x800b30000+0x60000, fw-data 0x801d50000+0xa4000. On every boot aurora.ko binds: "G14 firmware 27.2 running; compute-only DRM device registered", /dev/dri/renderD128.
    • Vulkan compute check (data[i] = data[i]·mul + add + i, every word checked on the CPU): 3 × 1024 dispatches passed on all 4 boots. 300 × 4096 passed on 1 of 4 (303/303, 64 ms, normal stop). On the other 3 it timed out at its 45th dispatch: 48 submitted, 48 completed, skipped-slots=480, normal stop, no Oops/BUG, clean rmmod. This is not the loader. The old trial loader, whose DT was hand-built, fails the same way on the same kernel (1 of 3 passed, the other two at exactly the same point). It is an intermittent stall in the compute series' command-pool slot reuse at the 49th command, the same place as before #2545's rework; a kernel-side follow-up.

Untested.

  • Render: supported by drm/asahi: render on the G14 firmware-27.2 runtime linux#3031 (on top of #2543/#2544/#2545/#2610).
  • Other T8112 machines (J415, J473, J493) on 27.2. They take this path if iBoot loads the same image (same nub uuid). Otherwise they stay disabled.
  • G13 Macs on 27.2: their images are not in the table, so they stay disabled as with kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381.
  • This head on hardware (Ryan's row: without the opt-in the GPU is disabled and the greeter works; with it, aurora binds and the 300 × 4096 check passes 3 of 3; rtc s2idle with aurora bound resumes without a PS gfx error). The last part is expected to fail today: s2idle with the 27.2 firmware running logged PS gfx: Failed to reach power state 0xf (linux#2544 finding).
  • Earlier head 10373aa as the default: udev autoloads aurora, compute passes (u1–u3, with linux#2544's slot fix f890a9c9), but the greeter dies; hence the opt-in.

Cross-references: #393 (T8122 handoff, whose reader and publication this reuses), #381 (contained), linux#2543, linux#2544, linux#2545.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

Finding from phellos (J413, 27.2 stub): with this PR in the default Stage 2, the GPU binds and the login screen dies.

One-shot trial boot of the up4 candidate (kernel 7.3.0-1-up4-ARCH = integration/aurora df62a8c4 + linux#2543–#2545 with the compute fix f890a9c9; Stage 2 = Aura main 3efa4a8 + #377, #381, #382, #227 isp.c + this PR at 10373aa), 2026-11-20:

  • The publication works. GPU node okay, udev autoloads aurora with no parameters, renderD128 appears. Compute works: u1–u3, 3/3 runs of the 300-dispatch check pass, with this Stage 2 and the default kernel's in-tree module.
  • The greeter crashes. The kernel logged IOCTL: submit failed! … err: EINVAL four times at 4.7–6.0 s, from two client files. That fits the greeter's compositor and Qt picking the compute-only node for rendering: the series rejects render submissions. Then Hyprland exits on SIGABRT and sddm-greeter-qt dumps core, twice. sddm is left with no greeter, so there is no login screen. The same kernel with the GPU left disabled (Stage 2 without this PR) runs the greeter normally.
  • The GPU doesn't sleep. The trial's rtc1 s2idle (with aurora bound and the firmware running) logged apple-pmgr-pwrstate … PS gfx: Failed to reach power state 0xf (requested 0xf00200f, now: 0xf002b0f). The system resumed.
  • Then phellos hung. After that s2idle, a manual fuser /dev/dri/renderD128; rmmod aurora; systemctl restart sddm hard-hung it: no ping, nothing in the journal after 107.8 s, a power cycle needed. Which of the three steps hung is not known.

What this means for merging. As a default on a desktop image, publishing the GPU is harmful until the kernel driver offers render, or until userspace stops choosing a compute-only node for GL. Options:

  • publish the handoff only when the loaded kernel driver is known to provide render;
  • or put it behind an explicit opt-in, for example a config/chosen flag that a compute trial sets.

The ADT-based identification itself looks right and isn't the problem. phellos's default stays on the Stage 2 without this PR, with the GPU disabled as before. A one-shot loader for compute trials is still useful as is.

🤖 Generated with Claude Code

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

Blocker: as the phellos row in this thread shows, merged as is this makes a default desktop boot of an M2 on 27.2 lose its login screen. The node goes okay, the kernel registers a compute-only render node, and the compositor and Qt pick it for GL and abort on EINVAL submits. Today the same machines boot to a working greeter with the GPU disabled (#381). The same row also showed PS gfx failing to reach its power state on s2idle with the GPU bound, and a hard hang after rmmod aurora.

  1. src/kboot_gpu.c:4471: the handoff runs on every T8112 with a matching image. Suggested fix: gate it on an explicit opt-in that a compute trial sets (a /chosen or boot config flag), and keep #381's behaviour as the default. Making it the default can wait until the kernel offers render, or until it keeps a compute-only device out of the way of GL userspace.

  2. src/kboot_gpu26.c:757: perf-states-sram is optional here. When the ADT has none, the GPU is still enabled, yet the PR says the 27.2 backend reads the per-state SRAM voltages from /chosen/aurora-gpu-resources/sgx. Its length is already checked earlier in dt_set_gpu(), but absence is not. Suggested fix: refuse the G14G handoff (leave the GPU disabled) when the property is missing, so the kernel never starts the firmware without those voltages.

  3. src/kboot_gpu26.c:694: g14g_target.sgx_compat is NULL, so gpu26_read_adt() accepts any /arm-io/sgx. Please require the T8112 sgx compatible as T8122 does. Identification then rests on two ADT facts (nub uuid and sgx compatible), not one.

The ADT-based identification itself (nub uuid plus __TEXT size, exact-length reads) looks right. The gpu26_* refactor keeps the T8122 host outputs byte-identical, as reported.

Hardware row: on our M2 (T8112), if it runs the 27.2 stub, boot this head one-shot as Stage 2. Without the opt-in: GPU node disabled and the greeter works. With the opt-in: "identified image g14g 27.2", aurora binds compute-only, and the 300 x 4096 Vulkan compute check passes 3 of 3 boots. rtc s2idle with aurora bound must resume with no PS gfx power-state error.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Two things in the current head, besides the opt-in already discussed above:

  • src/kboot_gpu.c, dt_set_gpu(): once firmware_gfx_version() identifies the image, handoff is set and the code runs through the existing operating-point block before it reaches dt_set_gpu_g14g_handoff(). That block bail()s with -1: missing perf-state-count, bad perf-states length, no operating-points-v2, "Expected %d operating points", any fdt_setprop_inplace failure, calc_power(). kboot_prepare_dt() turns any dt_set_gpu() error into a failed boot. With kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381 alone, T8112 on 27.2 never reached that block and always booted with the GPU disabled. With this PR, a DT whose OPP table doesn't match this ADT (another T8112 board, or a DTB without the fw27 OPPs) stops the boot instead. That is the same strictness every other chip gets, but it is not the "anything else leaves the GPU disabled" fallback the description gives. When handoff is set, could these failures go to gpu_leave_disabled(), or could the OPP writes move into the same FDT transaction as the handoff?
  • src/kboot_gpu26.c, dt_set_gpu_g14g_handoff(): perf-states-sram is optional here. Without it nothing is published under /chosen/aurora-gpu-resources/sgx and the GPU is still set okay, but the 27.2 backend reads its per-state SRAM voltages from there. Leaving the GPU disabled when the property is missing would keep this fail-closed.
  • Minor: g14g_target.sgx_compat is NULL, so any /arm-io/sgx is accepted. The image row is already chip-scoped, but requiring the T8112 sgx compatible would match the T8122 target.

The identification by nub uuid plus __TEXT size looks right to me.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

Thanks @RyanTheTide. All four points are addressed in dedad0b, on top of latest main (afc8ec1 merged in as e5fee3e; no force push):

  1. Opt-in. The G14G handoff is published only with chosen.asahi,t8112-gpu=1 (read through the existing /chosen opt-in helper). Without it, an identified image is logged as "identified; its handoff needs chosen.asahi,t8112-gpu=1" and the GPU stays disabled, so kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381's behaviour stays the default.
  2. Operating-point block. When handoff is set, every failure exit in dt_set_gpu() between identification and the handoff goes to gpu_leave_disabled() and the boot continues: perf-state-count/-table-count, the perf-states and perf-states-sram lengths, operating-points-v2, the count mismatch, the in-place writes, the leakage coefficients and calc_power(). A local macro returns -1 on every other path, so the other chips keep their strictness. The OPP writes that already succeeded stay in the DT, but with the node disabled nothing reads them.
  3. perf-states-sram. A missing property refuses the handoff: checked in dt_set_gpu() (GPU disabled) and again in dt_set_gpu_g14g_handoff(). The /chosen/aurora-gpu-resources/sgx publication no longer skips it.
  4. sgx compatible. g14g_target.sgx_compat is now gpu,t8112, the value in phellos's ADT.

Host results.

  • Builds with RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1, with the same warning set as main.
  • run-t8122-gpu26-identity.sh and run-t8122-gpu-diagnostics.sh pass.
  • run-kboot-gpu-g15.sh output is identical to main's apart from line numbers; both stop at the existing t8122-25-calibrated fixture.
  • CI's pytest set: 800 passed, 55 skipped.

Not done. No host test covers the new G14G paths, and this head has not been booted. Your hardware row (without and with the opt-in, then rtc s2idle with aurora bound) is not run: phellos is not booting with the GPU enabled while Satya is away. The s2idle part is expected to fail today (PS gfx: Failed to reach power state 0xf, tracked on linux#2544). The PR description is updated to match.

🤖 Generated with Claude Code

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

The blocker is resolved. No new blockers. Re-checked dedad0b against both of my comments.

Resolved:

  1. Opt-in: with an identified image but no chosen.asahi,t8112-gpu=1, dt_set_gpu() logs the image and returns gpu_leave_disabled(). #381's default (GPU disabled, greeter works) is kept.
  2. Operating-point block: on the handoff path, every bail()/return -1 between identification and the handoff now goes through gpu_fail() to gpu_leave_disabled(). The two has_cs_afr blocks still return directly, but has_cs_afr is only set for T602x, so T8112 never reaches them. A failed dt_set_gpu_g14g_handoff() also leaves the GPU disabled. Off the handoff path, gpu_fail() returns -1, so the other chips keep their strictness.
  3. perf-states-sram is now required in both places, and g14g_gpu_publish() always writes it.
  4. g14g_target.sgx_compat is gpu,t8112.

Still open:

  1. No boot of this head yet, and no host test covers the new G14G paths. One cheap test would pin the default: a harness run of dt_set_gpu() on a T8112 fixture with an identified image and no opt-in should leave status = "disabled" and return 0. A second run with the opt-in but no perf-states-sram should do the same.
  2. Minor, src/kboot_gpu.c:4464-4472: the comment says why the backend is opt-in. It could also say that s2idle with aurora bound is known to fail (linux#2544), so whoever sets the flag knows to keep suspend masked.

Hardware row, unchanged, on our M2 (T8112) on the 27.2 stub, this head one-shot as Stage 2:

  • Without the opt-in: the GPU node is disabled and the greeter works.
  • With the opt-in: "identified image g14g 27.2", aurora binds compute-only, and the 300 x 4096 Vulkan compute check passes 3 of 3 boots.
  • The rtc s2idle step is expected to fail until linux#2544 lands, so record it but don't gate on it.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

format-check (clang-format 20.1.8) flags two spots in src/kboot_gpu.c, both from this PR:

  • line ~4492, inside the gpu_fail macro: the line-continuation \ after handoff->string); is one column short of the others;
  • line ~4604: the gpu_fail("... found more\n", perf_state_count); call is over 100 columns and wants perf_state_count); wrapped onto its own line, aligned under the format string.

Running clang-format -i src/kboot_gpu.c with 20.1.8 gives exactly that; nothing else in the tree changes.

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.

Reviewed 7142214, which is dedad0b plus the clang-format fix. Approving the code:

  • The ADT-based identification (nub uuid plus __TEXT size, exact-length reads) is right.
  • Every exit between identification and the handoff goes to gpu_leave_disabled() on the handoff path, and other chips keep their strictness.
  • perf-states-sram is required.
  • sgx_compat is gpu,t8112.
  • The format-check fix only touches the two spots Ryan named.

Not merging yet:

  1. CI on 7142214. It's still running.
  2. No boot of this head. It changes what every T8112 on 27.2 gets at kboot, so it needs the J413 (M2 Air) on the 27.2 stub row on this head merged with main:
    • Without chosen.asahi,t8112-gpu=1: the GPU node is disabled, the "needs chosen.asahi,t8112-gpu=1" line is logged, and the greeter comes up.
    • With it: "identified image g14g 27.2", aurora binds compute-only, and the 300 × 4096 Vulkan compute check passes 3/3 boots.
    • Record the rtc s2idle result, but don't gate on it (linux#2544).

On the opt-in: our rule since yesterday is no runtime switches in merged code. I'll accept this one because the default it guards is #381's safe behaviour and the backend behind it is unfinished. Please add to the comment at src/kboot_gpu.c:4464-4472 that the flag goes away once the kernel offers render (or keeps a compute-only node away from GL userspace), and that s2idle with aurora bound is known to fail today.

This branch contains #381, which merges first.

Assisted-by: Claude Opus 5.5

@RyanTheTide

Copy link
Copy Markdown
Contributor

A correction to our earlier review, where we asked for an explicit opt-in. Under the project's production rule, a feature can't depend on a boot-config knob to work, and chosen.asahi,t8112-gpu=1 is such a knob. Keeping the GPU disabled by default (as #381 does) is the right state for now. The path to merge should be that the handoff is decided by what the system can actually do, not by the knob:

  1. The greeter failure comes from the compute-only node being offered for graphics. asahi, borealis: do not offer a compute-only device for graphics mesa#585 stops offering it (with drm/asahi: report the G14 firmware-27.2 device as compute-only linux#2610 for the feature bit). Once those land, the handoff can be on by default whenever the firmware layout is identified and perf-states-sram is present, and those conditions already gate this code.
  2. Then drop the chosen.asahi,t8112-gpu check (a local build can still carry it for development, but not the tree).
  3. The s2idle PS gfx failure (linux#2544) needs a fix or a known-issue note before it's on by default.

If you'd rather merge now with the GPU still disabled, please make the code path dead until 1 and 2 land rather than reachable by a knob.

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj
satchlj marked this pull request as draft November 21, 2026 03:35
@satchlj

satchlj commented Nov 21, 2026

Copy link
Copy Markdown
Member Author

Codex GPT-6.2 Sol on @satchlj's behalf.

Thanks @DjDeveloperr for reviewing the handoff and @RyanTheTide for correcting the opt-in guidance. All 16 CI checks passed on 7142214a. I've moved this PR to Draft and will hold it there until aurora-silicon/mesa#585 and aurora-silicon/linux#2610 land. In the meantime, #381 is the safe path to keep the T8112 GPU disabled by default on 27.2.

Once those dependencies land, we'll remove the chosen.asahi,t8112-gpu check and enable the handoff by default when the firmware layout is identified and perf-states-sram is present. We'll retest the greeter, compute and RTC s2idle on J413, and address the PS gfx failure tracked in aurora-silicon/linux#2544 or document it as a known issue before enabling the handoff by default.

@RyanTheTide

Copy link
Copy Markdown
Contributor

M2 (J413, T8112) row on 7142214 merged with main 83d2841 (Stage 2 1.0.0b13-g4d8e0e98), as an aura-try one-shot on the fleet kernel, with the configured Stage 2's DTB, U-Boot and config kept byte for byte.

This M2 runs a macOS 13.5 stub, so the G14G 27.2 identification isn't reached and this is a no-regression row only:

  • GPU node and Stage 2 GPU lines are the same as on a plain main 83d2841 trial on the same Mac. The whole Stage 2 log matches apart from the version string and CPU start-up timestamps.
  • aurora binds (renderD128), gdm comes up, 0 GPU errors.
  • Enforcing, 0 failed units, 0 AVCs, 0 kernel errors, 8/8 CPUs, internal panel, NVMe and Wi-Fi up, 0 DART faults.

The 27.2 part (without the opt-in: GPU disabled and the greeter works; with it: compute 300 x 4096 3/3) still needs a J413 on the 27.2 stub, and a kernel with linux#2543-#2545 for the opt-in half.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

The code review above stands; two things the thread hasn't covered, plus the state of the merge gate:

  1. Merge gate: the branch now conflicts with main (kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381 has merged as 1d8bea4), mesa#585 and linux#2610 are still open, and the chosen.asahi,t8112-gpu check (src/kboot_gpu.c:2216, :4478) is still the only thing keeping the handoff off. Per the plan already agreed in this thread, the respin should rebase onto main, drop the /chosen check, and gate on the conditions the code already checks (identified image, perf-states-sram, gpu,t8112) once the compute-only node is kept away from GL userspace. Until then it stays a draft.

  2. src/kboot_gpu.c:4349: gpu_leave_disabled() always logs "no initdata layout for firmware %s". On the handoff path (gpu_fail and the failed dt_set_gpu_g14g_handoff() at :4644) the reason is a refused handoff, not a missing layout. Pass the reason in, so a refused 27.2 boot doesn't read like the kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381 case in the log.

  3. Attribution: all commits carry Co-Authored-By: Claude trailers, and bcb51d4 has no Signed-off-by (it drops out once the branch is rebased onto main with kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381). Commits should carry only the human Signed-off-by; LLM help belongs in the PR body's last line, which this body already has.

Checked: the nub-uuid identification (src/firmware.c:579-596) only matches when no segment carries an image-info header and requires the exact __TEXT size, so other T8112 images and other chips stay disabled; gpu26_read_adt() still enforces the run-on VAs, 16K alignment, DRAM range and no overlap for the G14G target; the /chosen/aurora-gpu-resources/sgx blob is consumed by linux#2544. T8122's handoff output is unchanged per the host fixtures.

HW row: J413 (M2 Air) on the 27.2 stub, rebased head, default boot config: "identified image g14g 27.2", aurora binds compute-only, greeter comes up on the display path, 300 x 4096 compute 3/3 boots, 0 failed units, 0 AVC, no new kernel errors; record rtc s2idle (linux#2544). Plus a no-regression boot on an M2 on a pre-27.2 stub (GPU unchanged).

Assisted-by: LLM (Claude:Opus 5.5)

@satchlj
satchlj force-pushed the satchlj/t8112-gpu-272-handoff branch from 7142214 to 7cf34d4 Compare November 22, 2026 02:37
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf. Trailer-only rewrite, --force-with-lease from 7142214a to 7cf34d4f, every commit's tree unchanged: dropped four Co-Authored-By: lines and added Satya's Signed-off-by to bcb51d49, which had none; the two merges keep their main parents. The body now ends with Assisted-by: and no emoji footer, per the agent guidelines' pre-PR checklist §4.

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

…d image

On macOS 27.2 iBoot loads T8112's G14G GPU firmware as three gfx-asc
segments (__TEXT;__DATA;__DATA_SHARED_RO), and aura has no initdata
layout for it, so #381 leaves the GPU disabled. Linux's g14_v27_2
backend (aurora-silicon/linux#2543-#2545) starts that firmware itself
from the loader's handoff instead.

Route on the loaded image, not on the release:

- firmware_gfx_version() also identifies images without an image-info
  header, by the uuid iBoot puts in /arm-io/gfx-asc/iop-gfx-nub and the
  __TEXT size. One row: the G14G 27.2 image (26B123).
- When the G13/G14 path has no initdata layout and the image is
  identified, the operating points and leakage are published as usual,
  then dt_set_gpu_g14g_handoff(): #393's T8122 handoff reader and
  region publication, parameterised by target (log tag, sgx compatible,
  GPU node compatible, first-segment VA). For G14G the GPU node is the
  apple,agx-g14g one and the segment VAs must run on from the first.
  It reserves no-map and links ttbs, pagetables, handoff, shared-l2,
  fw-text and fw-data (__DATA + the read-only tail), and publishes
  apple,firmware-version/-compat from the image,
  apple,coredump-copy-buffer from the nub and
  /chosen/aurora-gpu-resources/sgx adt-perf-states-sram (the ADT
  property, which the kernel's 27.2 backend reads), then sets the GPU
  node okay, all in one FDT transaction.
- An unidentified image, or an ADT the handoff reader refuses, leaves
  the GPU disabled as #381 does.

T8122's messages and DT output are unchanged: all 95 host scenarios of
tests/kboot_gpu_g15_host.c give byte-identical output against main
(83 pass, the same 12 stand-in/calibration fixtures fail on both).

Signed-off-by: Satya Benson <satya@benson.earth>
Review of the handoff (RyanTheTide), and phellos (J413, 27.2 stub) with it
in the default Stage 2: the GPU binds, but the kernel's 27.2 backend is
compute-only and the greeter's compositor and Qt pick its render node for
GL; their submits fail with EINVAL and both abort, so there is no login
screen.

- Publish the handoff only with the boot config line
  chosen.asahi,t8112-gpu=1, which a compute trial sets. Without it an
  identified image is logged and the GPU stays disabled, as with #381.
- On the handoff path, the operating-point block no longer fails the
  boot: a missing perf-state-count or perf-state-table-count, a bad
  perf-states or perf-states-sram length, no operating-points-v2, an
  operating-point count mismatch, a failed in-place write, the leakage
  coefficients or calc_power() now leave the GPU disabled. Other chips
  keep the strict behaviour.
- A missing perf-states-sram refuses the handoff (checked in dt_set_gpu()
  and again in dt_set_gpu_g14g_handoff()): the backend takes each
  operating point's SRAM voltage from it.
- Require the T8112 sgx compatible, gpu,t8112 (phellos's ADT), as the
  T8122 target requires gpu,t8122.

Signed-off-by: Satya Benson <satya@benson.earth>
Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj force-pushed the satchlj/t8112-gpu-272-handoff branch from d75e302 to c6faace Compare November 22, 2026 22:03
@satchlj

satchlj commented Nov 22, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: rebased onto main (dc2f7e9) to clear the conflict. Old head d75e302, new head c6faace.

  • src/kboot.h and src/kboot_gpu.c: both sides add independent declarations (main's T8122 27.2 values and GPU firmware layout, this PR's G14G handoff). I kept both; nothing else changed.
  • The two merges from main and the aura#381 commit dropped out, since kboot_gpu: leave the GPU disabled when its firmware has no initdata layout #381 is on main now. The github-actions "gfya" commit that deleted the four policy copies also dropped out, so main's copies stay.
  • The three G14G commits are carried. It builds.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Checked c6faace. It is a rebase onto main and nothing else: 2d51f51, 0e5308b and c6faace carry the same changes as 53778bc, ea4aed9 and 7cf34d4 did (one return -1; lands in a different diff hunk where main's new context sits, and the code reads the same). The #381 commit, the merges and the gfya commit are gone, and each commit carries only the Signed-off-by.

From my last comment:

  1. The merge gate is unchanged. The chosen.asahi,t8112-gpu check is still the switch (src/kboot_gpu.c:2243, :4632), and mesa#585, linux#2610 and linux#2543-#2545 are still open, so draft is right for now.
  2. I withdraw the gpu_leave_disabled() log point. The handoff path runs only when there is no initdata layout (:4630), so the message is true, and gpu_fail() and the failed handoff already print "handoff refused" or "handoff not published" before it.
  3. Trailers: fixed.

New since the rebase, because main changed under this branch:

  • Main's T8122 27.2 hand-over (t8122_gpu_enable_27(), src/kboot_gpu26.c:463-502) enables the GPU mailbox and sets apple,no-auto-pm on the GPU power domain. Without it, Linux's pmgr arms GFX auto power-gating under firmware the kernel started itself. The G14G handoff (g14g_gpu_publish(), :782-811) uses the same start model but only sets the GPU node okay. Does the G14G 27.2 start need apple,no-auto-pm on its power domain too? It could matter for the PS gfx s2idle failure tracked on linux#2544. If it doesn't, please say why in the comment.
  • t8122_gpu_enable_27() now goes through gpu26_node(), which this PR parameterises, and a9c1917 and kboot_gpu26: hand the M3 (T8122) GPU to Linux on the 27.2 firmware #448 rewrote the 27.2 code around it. The earlier claim that T8122's output is byte-identical was made against the old main. Please re-run run-kboot-gpu-g15.sh and the T8122 27.2 host scenarios on c6faace and compare against main 8c16d19.

The hardware row is unchanged: J413 on the 27.2 stub at this head with the default boot config (GPU disabled and greeter up today; once the gate goes, "identified image g14g 27.2", compute 300 x 4096 3/3, rtc s2idle recorded), plus a no-regression boot on a pre-27.2 stub.

Assisted-by: LLM (Claude:Opus 5.5)

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

Independent source review at c6faacec128f. The current handoff still requires a boot config opt-in, and the PR records that turning it on without the Mesa consumer broke graphical login. Keep this as a draft until the loader, kernel and Mesa can publish and consume the hardware-derived GPU handoff on the normal boot path. Please verify a default J473 and 13.5 J413 boot after integration, as well as J473 compute, render, GNOME and suspend on the final stack.

The handoff was published only with the boot config line
chosen.asahi,t8112-gpu=1 because the kernel's 27.2 backend was
compute-only: with the GPU bound, desktop compositors picked its render
node for GL and failed. The backend now submits render work as well
(linux#3031), so the switch only keeps the GPU off on the default boot.

Publish the handoff whenever firmware_gfx_version() identifies the
loaded image. Everything else stays as it was: an unidentified image,
missing perf-states-sram or any operating-point/ADT problem on the
handoff path leaves the GPU disabled and the boot continues, and a
kernel without a backend for the firmware refuses the GPU node at
probe.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>

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

Formal pre-PR checklist re-audit (§1–§6) at live head c6faacec128fde6390f21ed4a344317afe43c1dd (Draft; base: main; CI 17/17 green; supersedes prior stale APPROVED at 7cf34d4f74).

Code, Stage-1 Safety & Hygiene Audit

  • Stage-1 / fail-closed safety (§3): Clean — touches Stage 2 kboot FDT setup only (src/firmware.c, src/kboot.h, src/kboot_gpu.c, src/kboot_gpu26.c), zero Stage-1/LocalPolicy/1TR changes. ADT nub-UUID + exact __TEXT size matching runs only when no image-info header is present, perf-states-sram and coredump-copy-buffer are required, and every error path fails closed via gpu_leave_disabled() while preserving iBoot UAT carveouts.
  • §4 Attribution & §6 Naming: Pass — rebase onto main (dc2f7e94) dropped prior merges and AI commit trailers; all 3 commits (2d51f51d, 0e5308b1, c6faacec) carry human Signed-off-by: only, and PR body ends with Assisted-by:.

Blockers Before Removing Draft / Enabling Default-On

  1. §2 Production-ready — chosen.asahi,t8112-gpu=1 opt-in knob (src/kboot_gpu.c:101, 162): Production features cannot require a boot-config opt-in switch. Keep in Draft until the consumer side is safe for default-on, then drop G14G_HANDOFF_OPTIN so publication is gated solely by verified machine/ADT inputs.
  2. Consumer readiness gate for default-on: Removing the opt-in while only the compute-only kernel (linux#2544) is live without linux#2610 + mesa#585 (both still open) breaks desktop login (compositors/greeter abort on EINVAL renders). Default-on requires either (a) full render landing (linux#2543 -> #2544 + #2979 + thermal policy -> #2545 -> #2610 -> #3031), or (b) linux#2610 + mesa#585 landed first for compute-only.
  3. §3 Thermal handoff contract (parity with merged aura#448): linux#2544's §3 thermal-policy blocker requires machine-sourced protection values (starting from aura#448's apple,fast-die0-target / apple,fast-die0-sensor-mask and any verified ADT alarm/correction properties). Publish the verified G14G ADT thermal inputs in g14g_gpu_publish() and fail closed when required protection inputs are missing.
  4. Power-domain apple,no-auto-pm / s2idle alignment (src/kboot_gpu26.c): Merged aura#448 (t8122_gpu_enable_27()) sets apple,no-auto-pm on the GPU power domain for kernel-started 27.2 firmware, whereas g14g_gpu_publish() does not. Confirm whether G14G 27.2 needs apple,no-auto-pm (and note the s2idle GFX-retention dependency on linux#2715 / per-board apple,sleep-retained before default-on).
  5. §5 Evidence on exact head c6faacec128f (and post-opt-in-removal head): Re-run T8122 27.2 host fixtures against live main (since gpu26_node() now backs t8122_gpu_enable_27()), plus exact-head J413/J473 27.2 default-config boot + pre-27.2 M2 no-regression boot with 0/0/0 regression gate.

Assisted-by: LLM (Gemini 4 Neon)

The kernel starts the G14G 27.2 firmware itself, with no PMP link, as on
T8122 27.2. Mark the GPU's power domain apple,no-auto-pm in the same
transaction that enables the GPU, as t8122_gpu_enable_27() does, so
Linux's pmgr never arms hardware auto power-gating of GFX under the
running firmware. A GPU node without a single power domain refuses the
handoff and leaves the GPU disabled.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Two follow-up commits pushed on top of c6faace (fast-forward, no force push; the PR stays draft):

  • 6223ca5 removes the chosen.asahi,t8112-gpu=1 opt-in. The handoff is published whenever firmware_gfx_version() identifies the loaded image, and every fail-closed path is unchanged.
  • 7eb35d2 marks the GPU power domain apple,no-auto-pm in the transaction that enables the GPU, the same rule and reason as t8122_gpu_enable_27(): the kernel starts this firmware with no PMP link. A GPU node without a single power domain refuses the handoff.

Status of the five items:

  1. Opt-in: removed (6223ca5).
  2. Consumer readiness: agreed. This stays draft and lands only after the render stack (drm/asahi: share the 26.x wire helpers and clean bound TTBAT slots linux#2543 -> #2544 -> #2545 -> #2610 -> drm/asahi: render on the G14 firmware-27.2 runtime linux#3031) is merged. It must reach the J473 default together with that kernel, never over a kernel without the 27.2 backend. Only T8112 on firmware 27.2 changes: the J413 runs 13.5 firmware, so its image is not identified and its path is untouched.
  3. Thermal inputs: open question, see below.
  4. apple,no-auto-pm: added (7eb35d2). The next J473 row reads back the live property and the s2idle retention with it.
  5. Evidence: the combined J473 row (M2-COMBINE) runs this exact Stage 2 with the arm64: dts: apple: t8112-j473-fw27: keep the GFX domain through system sleep linux#3038 DTB, plus a J413 13.5 no-regression row. Build is clean, and the host pytest results are identical to c6faace.
Item 3: what the J473 ADT carries

The J473's macOS 27.2 ADT (/arm-io/sgx) has no gpu-fast-die0-target, gpu-fast-die0-sensor-mask or gpu-fast-die0-alarm-threshold. It carries gpu-fast-die0-integral-gain (200.0), gpu-fast-die0-proportional-gain (5.0), gpu-avg-power-*, gpu-ppm-*, gpu-perf-* and gpu-power-sample-period, plus coredump-copy-buffer on the nub. Copying aura#448's fail-closed reader as-is would therefore leave this GPU disabled for good. The plan is to publish exactly what this ADT carries (the gains and sample period under the aura#448 names), have aurora-silicon/linux#2544 controller() consume those and fail closed when they are missing, and take any value the ADT does not describe from where the G13/G14 13.5 path already takes it. If you want a different source for the target and mask, say which.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

MERGETRAIN6 review at 7eb35d20e1c4. The default handoff remains conditional on the identified firmware image and valid machine data already checked by the existing path. The domain update is in that handoff's FDT transaction, so a missing single-domain phandle aborts the enable.

Blocking for the default release: the published handoff still needs the machine-sourced G14 thermal inputs and the matching Linux render path. Please carry the verified thermal properties from the machine as in #448, and keep the current failure behavior when required data is missing or malformed. The installed row needs J473 with the exact producer and render kernel, plus J413 and the existing T8122 and pre-27.2 boot paths.

Assisted-by: LLM (Codex)

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

Formal pre-PR checklist re-audit (§1–§6) at live head 7eb35d20e1c457ca2f1cc3e6243b8c8cd71694fd (Draft; base: main; supersedes review #6033427647 at c6faacec12).

Resolved Since c6faacec12

  • §2 opt-in knob removed (6223ca56e1c5): G14G_HANDOFF_OPTIN (chosen.asahi,t8112-gpu=1) is cleanly removed from src/kboot_gpu.c; handoff publication is now gated solely on firmware_gfx_version() identifying the loaded image and valid machine/ADT inputs, failing closed via gpu_leave_disabled().
  • Power-domain apple,no-auto-pm (7eb35d20e1c4): g14g_gpu_publish() (src/kboot_gpu26.c:814-819) marks the GPU node's single power-domains phandle with apple,no-auto-pm inside the same FDT transaction that sets status = "okay", refusing the handoff if a single power domain cannot be resolved — matching t8122_gpu_enable_27().
  • Stage-1 safety, §4 Attribution & §6 Naming: Pass — zero Stage-1/LocalPolicy/1TR changes; all 5 commits carry human author/committer and human Signed-off-by: only; PR body ends with Assisted-by:.

Remaining Blockers (Keep Draft / REQUEST_CHANGES)

  1. §3 Safety — machine-sourced G14G thermal inputs not yet published: g14g_gpu_publish() does not yet export the machine-provided ADT thermal properties required to remove linux#2544's hardcoded literals in RootV27_2::controller(). Appreciate the J473 27.2 ADT inventory in your comment (gpu-fast-die0-integral-gain, gpu-fast-die0-proportional-gain, gpu-avg-power-*, gpu-ppm-*, gpu-perf-*, gpu-power-sample-period, with target/sensor-mask/alarm-threshold absent from /arm-io/sgx); publish the verified ADT thermal properties present on G14G (failing closed when required ADT properties are absent/malformed) and lock down the exact machine-sourced contract with linux#2544 so no bare protection constants remain.
  2. Consumer readiness gate (keep Draft): With the opt-in removed, merging aura#402 before the restacked Linux render series (linux#2543 -> #2544 + thermal fix -> #2545 -> #2610 -> #3031) lands would publish an active 27.2 GPU node onto kernels lacking the matching render/thermal-safe backend. Keep Draft until the Linux render stack lands first.
  3. CI & §5 Evidence on exact head 7eb35d20e1c4:
    • CI: 15/16 passed (build, format-check, esp-stage2-size, stage1-size/*, macOS/arm64/llvm Pytest), 1 still running (Pytest (ubuntu-latest + gcc)).
    • Hardware & host evidence still required on exact head 7eb35d20e1c4: J473 27.2 default-config boot paired with the restacked render kernel (confirming apple,no-auto-pm live readback and s2idle retention with linux#3038), J413 no-regression boot, T8122 27.2 host fixture parity check against live main, and 0/0/0 regression gate.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

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.

Contract

What the machine provides (J473, /arm-io/sgx)

  • Present: gpu-fast-die0-integral-gain (200.0), gpu-fast-die0-proportional-gain (5.0), gpu-avg-power-, gpu-ppm-,
    gpu-perf-*, gpu-power-sample-period, gpu-pwr-min-duty-cycle, perf-states, perf-states-sram; nub coredump-copy-buffer.
  • Absent: gpu-fast-die0-target, gpu-fast-die0-sensor-mask, gpu-fast-die0-alarm-threshold, gpu-sochot-temp.

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.
m3/hw/t8122.rs writes the firmware word 11000 from its per-chip HwConfigA (unk_8cc, "how the two relate is not
known"). The ADT-to-word mapping is unproven on every chip we have (T8122: 88 vs 11000; T8103: 94 vs 9880).
So "aura#448 parity" in practice means: ADT values the kernel can use go through DT, and firmware words with no proven
ADT source come from the chip's hardware config. One copy per chip, shared with the chip's 13.5 path, never in the
runtime code.

Contract

  1. aura (G14G handoff, aura#402): no new properties are needed for the values the kernel uses. Gains, ppm, avg-power,
    perf and sample period are already published and read through hw/mod.rs prop! (required, no default; missing =
    probe fails). perf-states-sram and coredump-copy-buffer are required (kboot_gpu: publish the G14G firmware-27.2 handoff for a kernel-started image (T8112 compute) #402: missing = GPU left disabled).
    Optional: when the ADT has gpu-fast-die0-target / -sensor-mask / -alarm-threshold / gpu-sochot-temp, aura copies them
    as-is to apple,fast-die0-target / apple,fast-die0-sensor-mask / apple,fast-die0-alarm-threshold / apple,sochot-temp
    (aura#448 names, raw ADT value and units). The kernel does not derive firmware words from them until the mapping is
    proven; they are for diagnostics and for that proof.
  2. linux#2544 RootV27_2::controller():
    • 0x22d4 = cfg.da.unk_8cc, 0x2284 = cfg.da.unk_87c, 0x2f30 = cfg.da.unk_e24: hw/t8112.rs HwConfigA (11000 / 900 / 125),
      the same fields the G14 13.5 InitData writes (initdata.rs:327/338). Nothing changes on the wire; the literals leave
      the runtime code.
      unk_8cc/unk_87c map by offset (27.2 = 13.5 + 0x1a08). unk_e24 maps by position: in the 13.5 HwDataA it directly
      follows the sensor mask, as 0x2f30 follows the alarm mask at 0x2f28 in 27.2. It is per-chip (T8103 112, J313 ADT
      gpu-sochot-temp 111), so it is likely the SoC-hot alarm temperature in C. Likely, not proven.
    • 0x2288 = 4, 0x229c = 1.0, 0x2f34 = 1: controller constants (filter count, unity scale, alarm enable) that are
      literals in the 13.5 InitData and in G15 as well. They are not protection limits. Keep them, named and commented.
    • Already machine-sourced, unchanged: fast-die release temperature, sensor mask and PI gains (hwdata_a), ppm gains
      and max power (PwrConfig from DT).
  3. OPEN (the one value with no source): the per-sensor 5.3 corrections at 0x2320/0x2420/0x2f38/0x3038. They have no
    13.5, G15, G16 or G17 equivalent and nothing in the ADT. They need a decision (Dj/Ryan): either a documented source,
    or proof that the controller runs safely with the field left at its default, or the value is accepted as a named
    controller constant like 4/1.0.

Proposed #2544 change (owner: Satya, or us if he hands it over)

Replace (0x22d4, 11000), (0x2284, 900), ... (0x2f30, 125) with cfg.da.unk_8cc, cfg.da.unk_87c as u32,
cfg.da.unk_e24. Name the three controller constants. Leave 5.3 as is, with a comment pointing at the open item,
until it is decided.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

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 hw/t8112.rs (fast_sensor_mask 0x6800). The release temperature uses the hw/mod.rs default of 80 C, because this ADT has no source for apple,fast-die0-release-temp. Both fall under the same per-chip hardware config decision as 11000/900/125. Corrected text: work/m2gpu-publish/g14g-thermal-contract.md in the lab store.

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.

Follow-up exact-head verification at 7eb35d20e1c457ca2f1cc3e6243b8c8cd71694fd (0 code blockers remaining):

  • §3 Thermal contract blocker CLEARED: aurora-silicon/linux#2544 (181fe1878c15, already re-reviewed with 0 code blockers in #6034041761) now derives all G14 27.2 thermal controller parameters from cfg.da.* and cfg.unk_coef_{a,b} (matching the merged T8122 path with fail-closed EINVAL), so no extra DT thermal properties are required from aura#402.
  • CI: All 17/17 checks are now SUCCESS (including Pytest (ubuntu-latest + gcc)).

Remaining Non-Code Gates Before APPROVE

  1. Consumer merge order & ready state: Keep aura#402 behind the Linux G14 27.2 render stack (#2543 → #2544 → #2545 → #2610 → #3031 + #3038) and mark ready for review once ready to merge after Linux lands.
  2. §5 exact-head rows at 7eb35d20e1c4: Combined J473 27.2 default-cmdline boot (with full 0/0/0 failed-units / SELinux AVC / kernel-error delta tuple and apple,no-auto-pm + apple,sleep-retained readback), J413 no-regression boot, and T8122 27.2 host fixture parity check against main.

Ready to APPROVE immediately once those land.

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

J473 combined hardware row at 7eb35d20e1c4. J473 booted on the default command line with the signed combined kernel adec412c0223 and Stage 2 735f11c86f88. GNOME used the G14G GPU, Vulkan CTS recorded 384 passes and 248 unsupported cases with zero failures, and the same session and Vulkan smoke returned across 3/3 short suspend cycles. The candidate recorded zero GPU faults and zero failed units. The shared legacy-GPU regression on J413 or J316s is queued. The running DT confirms apple,no-auto-pm and apple,sleep-retained on GFX. The Stage 2 producer contains this exact head. Combined run and source receipt

Assisted-by: LLM (Codex)

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 24, 2026 07:22
@RyanTheTide
RyanTheTide merged commit 8b1cb8c into main Nov 24, 2026
17 checks passed
@RyanTheTide
RyanTheTide deleted the satchlj/t8112-gpu-272-handoff branch November 27, 2026 13:21
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