Repository navigation
drm/asahi: g16: Log cooling decisions at debug, ceiling edges at info - #2744
RyanTheTide wants to merge 6 commits into
Conversation
Rename the retained-session predicate to apple_pmp_t8132_retained_board() and detect the retained T8132 PMP power-vote bridge from the device tree's own `pmp` node (`apple,t8132-pmp-v2`, available, `apple,tunable-soc-device` present) rather than gating on a board list, root SoC compatible, or OS firmware version string. Keep apple_pmp_j713_board() as an inline alias for existing callers. Signed-off-by: Diljit Singh <hey@djdev.me>
… and run to top p-state Admit the J773g 25G83 firmware images, including the boot-filled B000 ranges zeroed before digest verification, and cover them in fwid.rs unit tests. Derive the firmware DVFS table row count (10-row 6-pair vs 11-row 5-pair+top) directly from the preserved ADT performance-state table rather than gating on a board compatible, and let the utilization governor, cooling ceiling, and reported p-state bound run up to the board table's top state (S10 on 11-row tables). Signed-off-by: Diljit Singh <hey@djdev.me>
… PB heap, and close VM caches Carry the G16 parameter-buffer and compute-pipelining updates needed under the 26B123 runtime: - unconditionally reuse a pass slot's retired PB epoch for the same VM and binding (no runtime toggle or mutable debugfs); - keep compute commands in flight on dedicated per-unit UMA slots; - share one 64 MiB PB heap per VM across render allocators, sizing the PB manager descriptor fields to the actual backed heap_blocks rather than hardcoding 256 MiB, and recycle never-exposed spare epochs; - let closed VMs release arenas while slot leases retain only their own backing, and drain spare epochs in both Registry::prune() and Gpu::vm_closed() to break the Cache -> Arc<VmState> cycle; - avoid redundant submit-path publication while a render is active. Signed-off-by: Diljit Singh <hey@djdev.me>
… idle power-off
Support the 26B123 G16 GPU firmware (also shipped in 26B131) while
leaving 25G83 byte-for-byte unchanged. Firmware selection keys strictly
on the boot loader's handoff fields and loaded TEXT digest, failing
closed on unknown builds.
Firmware layout, ABI, and ADT derivation:
- Add V25G83/V26B123 layout tables for InitData, device-control opcodes,
queue info, and TA/FS/compute work records, with compile-time
layout_fits() bounds and collision checks.
- Set POWER_PERFORMANCE +0xa4 = 1 (required power-up state selector)
with no undocumented static InitData policy words.
- Derive 26B123 power sampling (+4/+8, +0x2b48/+0x2bbc/+0x2c10) and the
average-power IIR filter (+0x29e4..+0x29f8) from /arm-io/sgx
gpu-pwr-sample-period-aic-clks, CNTFRQ_EL0, and /arm-io/pmgr/clpc
cpu-avg-limiter-input-tc; derive the low-peak (PPM) limiter filter and
PI gains (+0xa80..+0xae0) from cpu-lowpeak-limiter-{input-tc,ki,kp}
and gpu-power-sample-period (65536.0 PI integrator clamp at +0xaa8).
Fail closed with EINVAL when any required ADT property is missing or 0.
- Read coredump-copy-buffer from /arm-io/gfx-asc/iop-gfx-nub in the
preserved ADT to size InitData MAIN +0xfa8 and the 26B123 host
crash-log buffer (failing closed when absent or invalid).
Start, idle power-off, and runtime:
- Admit 26B123 firmware-owned page tables and perform the PPL magic
handshake, clearing handoff +8 before RUN and returning ETIMEDOUT if
the firmware answer does not arrive.
- Start 26B123 without a PMP AGX vote (enabling GFXCAXI2AF and leaving
loaded DATA to the firmware), hand over the host crash-log buffer
before AP power-on, and run the standard boot NOP + IMPORT_GLOBALS +
START sequence while accepting a pending InitData scheduler request.
- Publish the RETENTION table at RUNTIME +0x2c8 (leaving MAIN +0xfa0
zero) so 26B123 can power the GPU down when idle, and guard all SGX
MMIO reads/writes (engine busy/fault state, pstate(), and runtime
set_generation()) inside Session::while_powered() under the PPL lock.
- Attempt all three Globals ceiling selectors without short-circuiting
in floor_power() at fail-stop, drain all receive rings per pass, read
the 26B123 queue-info busy flag at +0x54, read compute work ticks from
compute::Layout::work_ticks with a tear-free hi/lo/hi loop, and check
the session once per poll pass plus before publish_checked().
Signed-off-by: Diljit Singh <hey@djdev.me>
… tests Add check-abi-26b123.rs and test-abi-26b123.py to verify 26B123 layout selection, compile-time policy collision guards, and exact byte-for-byte InitData/work/queue encoding parity against independent per-field offset tables. Extend test-perf.py for ADT power-sampling, low-peak limiter, and coredump-copy-buffer parsing; extend test-vm.py for 26B123 firmware page tables, +8 clear before RUN, and ETIMEDOUT on missing magic answer; and update the remaining host suites for the 26B123 ABI and compute work tick layout. Signed-off-by: Diljit Singh <hey@djdev.me>
service_power() logs every change of the cooling decision (governor, budget, backstop, sensor error, ceiling) with dev_info. Under sustained heat those inputs move several times a second. On the J713 (M4 Air, fanless) a desktop load at 97-104 C wrote up to 82 such lines in 10 s, enough to push older lines out of the kernel log buffer within minutes, and every boot writes about 15 while the startup hold lets go. Keep the full decision at dev_dbg. The info log gets only the two edges a user cares about: the ceiling dropping below the board's top state, and coming back to it, with the temperature and the number of decisions in between. The startup hold counts as below the top, so a normal boot logs one line when it lets go. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
This waits on #2676, which is still a draft; it can be folded into it or land right after it. Still needed: a J713 boot row showing one info line when the startup hold lets go and only the ceiling edge lines under a heat load. |
|
Boot half of the J713 row at 5c1fc1f (13-inch M4 Air): the info lines this change leaves on a normal boot with sleeps. The kernel is 7.3.0-bj713t6+: integration/aurora cacf355 plus the open J713 heads, including #2676 at ed41e08 and this PR at 5c1fc1f. It booted on the default command line (log in our
Still to run: the heat half. That means a sustained GNOME + 3D + video load on a kernel with this commit, counting the Assisted-by: LLM (Claude:Opus 5.5) |
Problem
G16 logs every change of its cooling decision at info level (
M4 cooling: sample_ns=... limit=S<n>). On a fanless M4 Air under sustained GPU load the governor, budget and backstop move several times a second. During a 97-104 C desktop load on the J713 that was up to 82 lines in 10 s, which pushes older lines out of the kernel log buffer within minutes. Every boot also writes about 15 of them while the startup hold lets go.Change
The full decision line moves to
dev_dbg. At info level, G16 logs only the two edges: the ceiling dropping below the board's top state, and coming back to it, with the temperature and the number of decisions in between. The startup hold counts as "below the top", so a normal boot logs one line when it lets go. The cooling policy itself does not change.Stacked on #2676 (
djdev/g16-272at ed41e08).Testing
make cpuin tools/testing/selftests/drivers/gpu/asahi-m4: 24/24 pass.power.rsis identical between drm/asahi: g16: run the M4 GPU on the macOS 27.2 firmware (26B123) #2676's ed41e08 and the head it was first built on.Still to run
Measurement
M4 coolinglines per 10 s in the soak's kernel log (t4, die hotspot 97-104 C): 5, 54, 72, 82, 58, 4, 14. Ceiling values seen in those lines: S1 28, S2 24, S3 14, S4 19, S5 19, S6 44, S7 58, S8 61, S9 22.