Skip to content

drm/asahi: m3: T8122: write the HwDataA +0x418c words on 14.8.3 - #95

Closed
satchlj wants to merge 1 commit into
omacom:integration/aurorafrom
satchlj:t8122-hwdata-418c
Closed

satchlj wants to merge 1 commit into
omacom:integration/aurorafrom
satchlj:t8122-hwdata-418c

Conversation

@satchlj

@satchlj satchlj commented Oct 13, 2026

Copy link
Copy Markdown

On an M3 MacBook Air (T8122) with the 14.8.3 GPU firmware, the GPU start stalls at the first device control:

M3: device control 0x13 acknowledgement timed out, elapsed_ns=...

followed by a device-control-failed verdict (-110). Testers in #26 report that it starts when the 20-word
block at HwDataA +0x418c..+0x41db is set, with nothing else changed, and that the stall returns without it. This PR
writes that block by default on that one profile, and adds a parameter to turn it off for an A/B test.

What it writes

20 little-endian u32 words at HwDataA +0x418c:

1, 500, 5, 12500 x5, 3000 x3, 12500 x8, 1

They were measured from the InitData macOS 26 writes on a J613 (10-core), read under the m1n1 hypervisor. They were
identical across six boots and are not present in the device tree.

Where and when

  • Only when the runtime backend builds the InitData on T8122 with the 14.8.3 firmware (m3_adt_config::build_images,
    gated on the T8122 table, the T8122 firmware layout and G15). Other SoCs and the 26.x (G16) path are unchanged.
  • The range is covered by the G13-era core_leak_coef[4..8], sram_leak_coef and aux_leak_coef fields, which the
    G15 builder leaves at zero. Compile-time asserts pin the block to exactly that range, so it overwrites nothing the
    builder fills.
  • asahi.t8122_hwdata_418c=0|1, default 1. 0 leaves the range at zero (the old behaviour). Any other value is
    refused by the parameter parser and the default stays. It is readable at
    /sys/module/asahi/parameters/t8122_hwdata_418c.

How to test

Boot this kernel the way you boot current14 now (with asahi.t8122_start=1). Look for:

M3 G15G: HwDataA +0x418c..+0x41db: the 20 words measured on a J613 under macOS 26 (asahi.t8122_hwdata_418c=0 leaves them 0)
M3 G15G verdict: firmware-running: ...

and no device control 0x13 acknowledgement timed out line. For the A/B, boot once more with
asahi.t8122_hwdata_418c=0: the first line then reads ... left 0 (asahi.t8122_hwdata_418c=0), and on the reported
machines the 0x13 timeout should come back.

Reported results (#26)

  • 10-core J613, 14.8.3 GPU firmware, system firmware 27.0: starts with the block; stalls at 0x13 without it.
  • 8-core J613, same firmware: starts with the block; it had stalled at 0x13 on the published release before (no
    same-build A/B yet).

Both results come from the testers' own local builds, not from this branch, which has not been booted yet.

What is not known

  • What the words mean. The field names above come from older GPU generations; the measured values are small
    integers, not floats, so those names probably do not describe this range on G15.
  • Whether the values are the same on every machine. They were measured on one 10-core J613 only.
  • Whether the 14.8.3 firmware reads the range with the same meaning as the macOS 26 firmware does.
  • J615 on the 14.8.3 firmware: not tested.

Checks

Build only (arm64, LLVM=1, rustc 1.93.1, CONFIG_DRM_ASAHI=y):

  • make W=1 drivers/gpu/drm/asahi/: builds; the same 26 warnings as the base, none new.
  • make CLIPPY=1 W=1 drivers/gpu/drm/asahi/: one new warning, the missing_safety_doc that m3_param! already
    emits for each of its 23 existing uses.
  • Host tests, rustc --edition=2021 --test tools/asahi/m3-runtime-tests.rs: 37 passed, 4 of them new (the words,
    their exact placement with every other byte unchanged, a short buffer, parameter parsing).
  • scripts/checkpatch.pl --strict: no code findings; it flags the British spelling "acknowledgement" (the driver's
    own log text), the new file without a MAINTAINERS entry, and the Assisted-by trailer format.

🤖 Generated with Claude Code

On an M3 MacBook Air with the G15 14.8.3 GPU firmware, the GPU start
stalls at the first device control: "device control 0x13
acknowledgement timed out" (-110). It did so in every boot reported in
omacom#26. Two testers there, with a 10-core and an
8-core J613, report that the start succeeds when the 20-word block at
HwDataA +0x418c..+0x41db is set to the values below, with nothing else
changed; on the 10-core one the stall returns without it.

The values were measured from the InitData macOS 26 writes on a J613
(10-core), read under the m1n1 hypervisor. They were identical across
six boots and are not present in the device tree. As little-endian u32:

  1, 500, 5, 12500 x5, 3000 x3, 12500 x8, 1

Their meaning is not known, and they have been measured on that one
machine only, so per-machine invariance is not established. The range
is covered by the G13-era core_leak_coef[4..8], sram_leak_coef and
aux_leak_coef fields, which the G15 builder leaves at zero; the
measured words are small integers rather than floats. Compile-time
asserts tie the block to exactly that range.

Write the block by default when the runtime backend builds the InitData
on T8122 with the 14.8.3 firmware. Add asahi.t8122_hwdata_418c (0 or
1, default 1; readable in sysfs) so that a tester can boot with 0 for
an A/B comparison; any other value is refused. One line in the kernel
log says which was used. Other SoCs and the 26.x (G16) path are not
affected. J615 on the 14.8.3 firmware has not been tested.

Add host tests (tools/asahi/m3-runtime-tests.rs) that check the words,
that they land at exactly +0x418c..+0x41db with every other byte
unchanged, and the parameter parsing.

Assisted-by: LLM
Signed-off-by: Satya Benson <[email protected]>
@chriskearney

Copy link
Copy Markdown

Thanks @satchlj, this is merged through #112.

  • It's your commit with you as author, rebased onto the current integration/aurora. The only conflict was in tools/asahi/m3-runtime-tests.rs, where both sides were kept.
  • I reworded the comments, one test name and the kernel log line to describe what the code does, as our house style asks. The code is unchanged.
  • Review: every other Mac and firmware profile keeps byte-identical InitData. The kernel builds with no warnings in the touched files, the host tests pass 54/54 (4 new), and test_air_gpu passes.

Before a release says this is fixed, could one of the #26 testers boot integration/aurora as it is now with asahi.t8122_start=1 on the 14.8.3 profile? The earlier passing boots all used local patches.

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.

2 participants