Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
eed1127
arm64: dts: apple: expose J700 SoC and enclosure thermal readings
RyanTheTide Nov 1, 2026
c9fca63
drm/asahi: document GPU thermal integration and owner qualification
RyanTheTide Nov 1, 2026
d762248
dt-bindings: gpu: apple: describe firmware percent cooling ceilings
RyanTheTide Nov 1, 2026
9b12783
drm/asahi: prepare common firmware percent cooling with ABI admission
RyanTheTide Nov 1, 2026
90da043
arm64: dts: apple: add provisional J700 GPU outer protection
RyanTheTide Nov 1, 2026
940825b
drm/asahi: publish live absolute GPU power ceilings
RyanTheTide Nov 6, 2026
6f11998
drm/asahi: preserve WC ordering for both PPM mappings
RyanTheTide Nov 6, 2026
5e23eb2
docs: describe PWR qualification for Neo and J616s cooling
RyanTheTide Nov 7, 2026
cfe3844
Merge integration/aurora 43c790fe into pwr/gpu-cooling-v2-20261107
RyanTheTide Nov 7, 2026
df7f7f1
arm64: dts: apple: t8140-j700: no critical trips on the new SMC zones
RyanTheTide Nov 7, 2026
f616160
Merge integration/aurora into pwr/gpu-cooling-v2-20261107
RyanTheTide Nov 19, 2026
1fbf7af
tools/asahi: t6040 calibration test: build g17/fw/power.rs too
RyanTheTide Nov 19, 2026
0166fa3
drm/asahi: g17: no live power layout for the M5 firmware
RyanTheTide Nov 19, 2026
45b5650
drm/asahi: g17: give the M5 session an empty cooling owner
RyanTheTide Nov 19, 2026
ab10dc1
drm/asahi: g17: start the GPU without cooling when the layout has none
RyanTheTide Nov 19, 2026
00e0a70
drm/asahi: g17: restore the 110 C die limiter target
RyanTheTide Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Documentation/ABI/testing/sysfs-driver-aurora-gpu-cooling
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
What: /sys/devices/platform/.../gpu_power_ceiling
Date: November 2026
Contact: Asahi Linux contributors <asahi@lists.linux.dev>
Description:
Read-only diagnostics for the admitted G16S/G17P absolute-power
actuator. One key/value pair per line:

requested_state: thermal cooling state, 0..100.
requested_ceiling_mw: minimum of all retained requester ceilings.
applied_ceiling_mw: last completed host shared-memory publication.
provisional_floor_mw: 25 percent of the initialized maximum,
rounded down, but never zero. Pending hardware qualification.
achieved_ceiling_mw: unsupported; not inferred from a nominal OPP.

Applied is a host publication, not firmware acknowledgement or
measured GPU power. The debugfs asahi-<device-name>-power/ceiling
file also reports separate RegionC/PPM readbacks, initialized max,
PPM enable and the thermal/fast-die/system/manual request slots.
State N requests max(25, 100 - N) percent of initialized power.
Critical shutdown never relies on the provisional floor.
10 changes: 10 additions & 0 deletions Documentation/devicetree/bindings/gpu/apple,agx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ properties:
$ref: /schemas/types.yaml#/definitions/phandle
description: PMP firmware provider owning the GPU power vote and telemetry

"#cooling-cells":
const: 2
description: |
GPU firmware absolute-power ceiling. State N requests (100 - N)
percent of initialized maximum power, for N in 0..100, bounded below
by a provisional nonzero minimum until hardware qualifies the low end.
A firmware layout without a live power state leaves the GPU without
this cooling device. Other policy owners may impose a stricter
ceiling than the thermal framework requests.

operating-points-v2: true

apple,csafr-min-sram-microvolt:
Expand Down
206 changes: 206 additions & 0 deletions Documentation/gpu/asahi-gpu-thermal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
.. SPDX-License-Identifier: GPL-2.0-only OR MIT

GPU thermal integration and qualification
=========================================

Live power owner
----------------

G17P/T8140 and G16S/T604x share the ``g17`` backend. The admitted live
actuator publishes an absolute ``u32`` milliwatt ceiling to the separately
allocated ``RegionC::max_power_mw`` at +0x84 for G17P 26A428 and G16S 25G83.
These are firmware fields, not offsets in a host service object. The obsolete
host-object mirror model has been removed. G16S 26A428 has a distinct typed
+0x88 prefix but no admitted initialization graph or live actuator. V25F84
also has no live-power admission. Never reuse the common field for either.

``PowerState::ppm_enabled`` (+0x128) and ``ppm_target_mw`` (+0x12c) are
separate typed fields in another object. The owner retains the initialized
PPM budget and bounds its published target by the composed ceiling. It never
aliases the RegionC maximum with the PPM target, a percent, an OPP, a PMP vote
or the performance effort floor. A zero/uninitialized PPM budget uses the
initialized RegionC maximum; a zero RegionC maximum rejects registration.
G16S uses the initialized per-chip maximum, not the zero placeholder in its
static configuration.

A dedicated mutex serializes thermal, fast-die host-policy, system-budget
and manual request slots and their publications. The thermal framework
aggregates zone demands by maximum cooling state. The owner takes the minimum
of all absolute requests, so one requester relaxing cannot lift another's
ceiling. All future host budget/manual producers must use this owner rather
than write the fields directly. The firmware fast-die limiter operates
independently and is not replaced by the host fast-die request slot.

State N requests ``max(25, 100 - N)`` percent of the initialized maximum,
rounded down in milliwatts, with a minimum of one milliwatt for tiny test
inputs. The 25 percent floor is **provisional**, not a qualified board minimum
or a claim about a physical pstate. State 100 does not publish zero or stop
the GPU. Absolute requests below the provisional floor are rejected, preserving
the previous restriction.

Registration publishes the floor before INIT, port attachment and submission;
its initial cooling state is 100. The governor may subsequently relax its own
request. The previous applied value and all requests survive a failed
publication. The current mapped stores are infallible after registration
validates every destination. Recovery republishes the committed restriction
before reopening consumption. Teardown drains debugfs, sysfs and thermal
callbacks before stopping processors or freeing mappings.

RegionC is CPU write-back memory, so publication includes a clean to the point
of coherency. Both admitted PowerState mappings are write-combined and use
store ordering rather than cache cleaning. Ordering is completed before publication is
reported. There is no firmware mailbox, doorbell or acknowledgement for these
inputs. Shared-memory readback proves publication, not achieved GPU power.

Fast and outer protection
-------------------------

Before submission opens, the G17 firmware die limiter is initialized with
sensor mask ``0x82a``, target 110 C, release 80 C and its native 16 ms period,
with its existing gains: the values the driver used before this cooling work.
They are not device safety ratings. Changing the target needs a sustained-load
temperature and performance measurement on the board.

The cooling device is optional. A board with ``#cooling-cells`` whose selected
firmware layout has no live power state (V25F84 and the packed M5-profile
graphs, among them the M5 26A428 and the common 26B123 graph) starts the GPU
without a cooling device and logs that once at probe; the firmware die limiter
and the SMC zones below still apply. A malformed ``#cooling-cells``, invalid
mappings and a zero initialized maximum still fail initialization.

J700 has independent SMC thermal zones:

=================== ===================== =============
Zones Cap temperatures (C) Hot (C)
=================== ===================== =============
Tp*/Tpx* 85, 88, 92, 95 92
Charger (TCMz) 80, 83, 88, 92 88
Chassis (Ts0A/I/M) 70, 75, 80, 85 80
=================== ===================== =============

These zones have no critical trips. A sensor index that reads the wrong
channel, or a value the driver misparses, must never power the machine off.
Critical trips are added per zone only after its sensor has been read and
matched to its key on hardware with the trips disabled. Until then the SMC
and the platform firmware keep their own overtemperature protection.

Cooling states 25, 50, 75 and 100 apply 75, 50, 25 and the provisional
25 percent floor, with 5 C hysteresis. The last two states deliberately
coalesce until hardware qualifies a lower minimum. DT uses ``active`` trips
with equal lower/upper states, supported by both power_allocator and
step_wise for this non-power-actor device. SMC polling at 100 ms cannot
accelerate source refresh and does not replace the fast firmware limiter.

Diagnostics
-----------

``/sys/devices/platform/.../gpu_power_ceiling`` reports the requested thermal
state, composed requested and applied ceilings in mW, and provisional floor.
``/sys/kernel/debug/asahi-<device-name>-power/ceiling`` additionally reports
the initialized maximum, both live words, PPM enable and each request slot
(0 thermal, 1 fast-die host policy, 2 system, 3 manual). Applied means the host
completed the shared-memory publication; achieved power remains explicitly
unsupported. These diagnostics are read-only. A firmware pstate alone is not
an acknowledgement of either power input.

Offline verification
--------------------

Run on a build host, without a GPU::

python3 tools/testing/selftests/drivers/apple/gpu-cooling.py

The host suite exercises the production C policy plus the exact typed Rust
PPM and unadmitted G16S 26A428 layouts. It covers all 101 states, floor
rounding, integer limits, every thermal/non-thermal request pair in both
orders, four-owner composition, separate PPM budgets, startup, failed
publication and recovery. Run the same C suite under arm64 QEMU::

python3 tools/testing/kunit/kunit.py run --arch arm64 --jobs 8 \
--kunitconfig drivers/gpu/drm/asahi/.kunitconfig.cooling \
--make_options LLVM=1 'asahi-gpu-cooling*'

Compile ``apple/t8140-j700.dtb`` and check the outer policy::

python3 tools/testing/selftests/drivers/apple/j700-thermal-dt.py \
--dtb out/arch/arm64/boot/dts/apple/t8140-j700.dtb

These tests do not qualify firmware-achieved power or a safe minimum.

PWR owner qualification: Neo and J616s
-------------------------------------

This revision performs no device test. Request separate controller-approved
one-shots for Neo (G17P) and J616s (G16S), identifying each device, exact
source and boot artifacts. Build
with the unique release suffix ``-aurora-t5402-gpu-cooling-v2-01``; verify
``uname -r`` matches it after boot. Preserve the fleet-default kernel/DTB,
artifact hashes, boot entry and bootguard fallback before staging. Record
candidate and fleet commits, firmware identity, Mesa, workload, power source,
ambient conditions and starting temperatures. Keep private lab records outside
the public source tree.

J700 supplies the GPU cooling binding and outer policy in this series.
J616s currently has no GPU ``#cooling-cells`` or GPU cooling-map references;
the actuator is therefore not attached there. Before qualifying J616s,
the PWR owner must review a separate board policy with indexed sensor
identities, trips, hysteresis and exact GPU
cooling states. Validate its compiled DTB and firmware admission before
requesting a one-shot. Existing CPU cooling maps do not qualify GPU binding.
An absent GPU cooling device or zone link is a failed prerequisite, never
evidence that G16S thermal integration passed.

First boot with no GPU load. Verify the cooling device, independent thermal
zones, sensor readings against their keys, requested/applied/readback agreement and nonzero
PPM target. Set state 100 and verify the initialized maximum's 25 percent
floor (2387 mW for a 9550 mW maximum), never zero. Check states 75, 50, 25 and
0 at no load, returning to 100 after each. Confirm the PPM word remains a
separate target and never exceeds its retained budget or the applied ceiling.
Test that one thermal zone relaxing cannot release another zone's demand.
Capture invalid-state rejection, restrictive reset/recovery and callback
teardown. Prove the independent supervisor's stop latency before applying load.

Use existing fleet-default traces for the first comparison. If matched traces
are unavailable, request a separate bounded baseline test; do not recreate a
sustained unrestricted baseline. For both fleet default and candidate, record
the actual cap and compare identical workloads from matched cool temperatures.
Start with at most 100 ms GPU bursts, one workload at a time, with state 100
applied. Only step toward higher allowed power after readback and cooldown
succeed. No games, full CTS or multi-minute benchmarks in this one-shot.

Capture monotonic timestamps, requested/applied RegionC ceilings, PPM target,
all relevant temperatures and read errors, available firmware die telemetry,
achieved pstate/power quality, frame times and limiting reasons. Compare
frame-time p50/p95/p99/max, throughput, peak temperature, time above each trip
and cooling residency against fleet default, labeling different power caps.
Readback is not achieved-power evidence. Qualifying a lower floor requires
independent achieved-state evidence and a separately reviewed test.

For each board, retain a thermal-zone-to-cooling-device inventory and a
timestamped trace of governor-driven state transitions under the bounded
GPU load, including hysteresis and overlapping zone demands. Exercise both
restriction and relaxation without lowering critical trips. Keep load
bounded by the independent supervisor and the initial burst limits above.

After those stages pass, request a separately bounded gpubench comparison
using the same Mesa, workload, resolution, power cap, power source and cool
starting conditions on fleet default and candidate. Use repeated samples;
retain throughput and frame-time distributions. Accept only no regression
outside the matched baseline's measured repeatability; differing caps or
conditions require a new matched comparison. Do not treat expected throttling
at a different cap as a performance-parity result.

Capture complete boot logs and SELinux audit evidence for both kernels on
each device. Require zero new boot-log warnings against the matched baseline
and zero AVCs with SELinux enforcing throughout boot and the workload. Keep
all failures and the restored-kernel checks with the qualification receipt.
Neither board is qualified until binding, load transitions, gpubench parity,
boot-log comparison and SELinux checks have all passed on that board.

Stop bursts on a failed cap update, readback mismatch, missing or implausible
telemetry, lost binding, GPU fault or supervisor action. Keep the strongest
request, preserve traces and restore the fleet-default kernel/DTB using the
one-shot fallback. Do not extend bursts unless source refresh and stop delay
bound overshoot below every critical trip and 100 C. After rollback verify
the restored release, boot entry, zone identities and cooldown. Retain failure
and rollback evidence; a rollback is a failed qualification, not a pass.
1 change: 1 addition & 0 deletions Documentation/gpu/drivers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GPU Driver Documentation
asahi-reclaim
asahi-usage-stats
asahi-m4-bringup
asahi-gpu-thermal
apple-dcp-m4
i915
imagination/index
Expand Down
Loading
Loading