Repository navigation
drm/asahi: g17: M5: apply the controller defaults on every part - #2080
Merged
DjDeveloperr merged 1 commit intoNov 16, 2026
Conversation
Isaac-Duarte
marked this pull request as ready for review
November 16, 2026 15:52
The M5 power-controller configuration of a board (the relative power
curves, the policy words, the maximum power and from there region C's
maximum power) is applied only when the GPU's leakage calibration words
equal those of the one part it was read from: on J714 (M5 Pro) and
J716c (M5 Max). Every other part keeps the firmware's default budget,
and its GPU stays near its lowest performance state under any load. The
gate was not intended.
Drop it: a board's controller configuration now applies on every part.
The leakage inputs stay the reference part's: the driver does not decode
a part's own leakage from its words, and the maximum power that would go
with it is not known. The firmware holds its power estimate, not the
actual draw, to the maximum, so a part that leaks more than the
reference draws more than the estimate says; the firmware's
temperature-based emergency clamp still applies. J775D's configuration
was never gated, and J813 has none.
On a J714s whose words differ (0xe703b401 0xea3e1410 0x8af41f61), the
GPU time of a gpubench compute.heavy job, against macOS on the same
machine:
before after macOS
ALU job, us 1291 272 267
bandwidth job, us 844 488 487
and in a 10-minute ALU soak on firmware fan control, the same power and
temperatures as macOS: system power 46.6 W (macOS 46.5 W), TCMb peak
103.1 C (macOS 103.5 C).
Signed-off-by: Isaac Duarte <[email protected]>
Isaac-Duarte
force-pushed
the
j714s/gpu-controller-defaults
branch
from
November 16, 2026 16:17
2b7ef42 to
a250d9c
Compare
DjDeveloperr
merged commit Nov 16, 2026
bf423bf
into
aurora-silicon:integration/aurora
1 check passed
This was referenced Nov 16, 2026
rolotrealanis98
added a commit
to rolotrealanis98/linux
that referenced
this pull request
Nov 17, 2026
…t's leakage aurora.m5_controller_defaults=1 gave the J716s J714's GPU power-controller configuration as it stands, leakage inputs included: those of the one J714 part it was read from. The leakage is a per-part fuse value the boot loader already hands over (apple,leakage-calibration-words, which aura reads on the J716s too), and aurora-silicon#2080 located its fields: read as one 96-bit little-endian value, a divisor in bits [0:8), the clusters' fields in [8:22) and [22:36), SRAM in [37:46) and AFR in [56:68) reproduce the hard-coded leakage of both J714's and J716c's reference parts exactly. Give the J716s its own configuration, encode_m5_policy_controller_defaults_j716s: J714's, with this part's leakage decoded at every boot. M5Leakage decodes the words with integer arithmetic only (values in half units, written as IEEE singles without the FPU) and refuses any value outside half and twice J714's reference; compile-time checks pin the decode and the encoding to both reference parts' hard-coded words. Without valid words the switch changes nothing and says so. What stays J714's, and why: - The relative power curves and the 98884 mW maximum: macOS computes them per part from the perf-state voltages and the leakage with a power model that is not known (one model of the aura calc_power_t600x form does not fit J714's and J775D's together). On the J716s's higher voltages and leakage the firmware's top-state estimate comes out some 3-9 % above this maximum, so it may hold the GPU just below the top state under a sustained full load: on the safe side. - The controllers' gains, thresholds and timings: the kext's configuration for the core type, 0x18 on both. The J716s ADT GPU node has no power tunables, and 143 of its PMP node's 146 equal J714s's. - The AON temperature records and sensor channel masks: the J716s ADT aon-ptd rows are J714's. The perf-state voltages were already the J716s's own (J716S_GPU_PERF_STATES, from its ADT). Still boot only, default 0 (unchanged). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On every M5 Pro and M5 Max except one reference part each, the GPU never gets its power-controller configuration. The M5 builder (
g17/initdata/m5.rs) installs a board'scontroller_defaults(the relative power curves, the policy words,M5_POLICY_MAXIMUM_POWERof 98884 mW, and from there region C's maximum power) only when the GPU node'sapple,leakage-calibration-wordsequal the board'scalibration.J714andJ716Chard-code the words of the one part their configuration was read from (J714:0xd2035701 0xac3a1280 0x0a281d81). Any other part keeps the firmware's default budget, and its GPU stays near its lowest performance state under any load. On my J714s (words0xe703b401 0xea3e1410 0x8af41f61) a compute job took 4.8 times as long on the GPU as it does under macOS. 6d8d401 (J716c) already says so for J714: "a unit whose calibration words differ keeps the default budget".This drops the gate: the
calibrationfield and its check are gone, and a board's controller configuration applies on every part. DjDeveloperr confirmed the gate was not intended. The leakage inputs in each configuration stay the reference part's (see "Not done" for why). The firmware holds its power estimate to the maximum, not the actual draw, and the estimate uses those leakage inputs, so a part that leaks more than the reference draws more than the firmware believes. Mine does: its leakage fields are 8-15% above J714's reference (table below). The firmware's temperature-based emergency clamp still applies;g17/thermal.rsdocuments that J714 at this maximum can reach it under sustained load, and the governor that avoids it is opt-in (m5_thermal_governor, default off). On this part, the soak below matched macOS for power and temperature.Machines. Every T6050 machine whose board has a controller configuration now gets it on every part:
J714board,hw/t6050.rsCONFIG): J714s, J716s, J873s, K114s and K116s. Only the J714s has run it.J716Cboard,CONFIG_MAX): every M5 Max but the reference part had the same problem and now gets J716c's configuration (196098 mW maximum). I have no M5 Max; this is untested.Unchanged: M5 Ultra (
J775D: synthetic leakage, never gated) and T8142 / J813 (no controller configuration;t8142::PROBEnamesJ714but is only the base oft8142::CONFIG, which usesJ813).Measured on J714s (gpubench
compute.heavy, the same test as a macOS 27.2 M5 Pro record; lily is the Vulkan LLM engine):The "after" column is a module with only this change, built for the running kernel. lily's output was bit-identical before and after (same digest).
Sustained load, firmware fan control: 10 minutes of back-to-back
compute.heavyALU runs (depth 4), started at TCMb < 50 C, no userspace fan tool. The fans stayed off until about 100 s (TCMb 92 C), ramped slowly and reached their ceiling (about 4950/5350 rpm) only at about 500 s. TCMb peaked at 102.7 C at about 230 s, with the hottest GPU die sensor at 96 C, and settled near 90 C. The emergency clamp (the GPU pinned to its base state, which would cut a sample to about a fifth) never engaged: throughput had a median of 7879 GFLOPS, with short dips of 3-6% (7411-7655 GFLOPS) at the 101-103 C peak and two more at about 91 C at the end. dmesg showed no GPU or thermal messages. For comparison, a run where a more aggressive userspace fan curve took over after 70 s held TCMb at 81 C with no dips. This is one ALU-bound load on one part in a 14-inch chassis; a part that leaks more than this one will run hotter.Against macOS on the same part. macOS 27.0.1 computes this part's configuration from its own fuses, so running the same soak there shows whether the reference leakage makes Linux drive this part harder. Same machine, same gpubench test (the Metal executor), started at TCMb < 50 C, firmware fan control, SMC keys read the same way on both:
On this part, Linux with the reference leakage draws the same power and reaches the same temperatures as macOS with the part's own. macOS throttled a little deeper (to -11%, Linux -6%), and its unthrottled throughput is about 3-4% higher at the same per-job GPU time, the difference in how queued jobs overlap. That is one part; a part whose leakage differs from the reference in the other direction, or by more, is not covered by this.
Not done: per-part leakage. I tried to derive each part's leakage from its own words. The fields can be located: read as one 96-bit little-endian value, the words reproduce both boards' hard-coded leakage exactly.
So cluster leakage = 2 × field / byte 0, SRAM = field / byte 0, and AFR = field. I did not implement this, for three reasons:
calc_power_t600x). A part's own leakage probably needs its own maximum power, and the M5 model is not in the tree.A follow-up needs a second M5 Pro's policy as macOS writes it, read under aura. T6040 already has the shape for it:
g17/calibration.rstakes the per-chipleakage[56]andmax_power_mwfrom the boot loader's handoff.Testing:
Board { calibration: None, ..J714 }: on the M5 Pro, the same behaviour as this commit, which removes the gate instead. The measurements above are from that module, built for the running kernel (integration/aurora c33c5fd plus unrelated USB-C, HID and Wi-Fi patches; none touch the GPU); the change applies unchanged on the current integration/aurora.tools/ci-local.sh(host tests and DT checks, merged onto the current integration/aurora): all host tests passed. The DT checks were skipped because nothing in the DT changed. The host tests do not build the asahi module, so I built it from this change (aurora.o, with the running J714s config and rustc 1.100): no errors, no warnings in the touched files.CONFIGand get the 20-core model), idle and battery power with the configuration applied, soaks longer than 10 minutes, other loads (render, mixed CPU+GPU), and suspend/resume.