Skip to content

J613: qualify GPU states 6–8 with active thermal protection #164

Open

Description

@garymeyerca

Scope and requested outcome

Track qualification and review of GPU states 6–8 on J613 with active thermal protection, as a follow-up to #135 and #146. The author of #146 confirmed that higher GPU states are outside that PR's scope. The sensor/CPU-zone validation should remain there; this issue collects the separate GPU admission change and its evidence.

The local release-20 experiment reaches the native firmware-table maximum, with tested fallback and recovery. The next step is to review how this should map onto the current driver and what further qualification maintainers require. This is not a request to change the default ceiling to state 8. The experiment keeps boot/default/fallback at state 2. It is not yet a current-base patch submission or a claim of general daily-use stability.

Related: #26 (firmware-profile qualification). Camera, backlight and USB-C/clamshell work remain in their own threads.

Machine and exact tested builds

  • MacBook Air 13-inch M3, J613 / T8122, 8 active GPU cores, Omarchy.
  • Exported OS firmware: 14.7; system firmware: 27.0. Older 14.x GPU profile, RTKit 2419.140.12.release (GPU firmware 14.8.3).
  • Bootloader package m1n1-aurora 1.6.1.aurora17-5; Mesa mesa-m3 26.1.4.m3.2-5; Hyprland 0.56.2-7.
  • Experimental Mesa opt-in enabled; Apple M3 hardware rendering through Zink/Honeykrisp, with OpenGL and Vulkan readback checks.
  • Base: Aurora release 20, c46d7dcdb8712ea9aeb0ce47b439ffae76371e55, plus drm/asahi: retain state 2 as the T8122 thermal fallback #135 at 46b5a0981c4955cf33b7275c4001d820791b9f08 and j613: CPU thermal zones and SoC die sensors (MacBook Air 13" M3) #146 at 8fd1bf481afe6fcadaa04001b2bcd435616b705b.
  • Separate pacman-owned kernels: 7.1.12-2-20261019.146135cap6-test-ARCH, 7.1.12-2-20261019.146135cap7-test-ARCH, 7.1.12-2-20261019.146135cap8-test-ARCH. Same kernel configuration; progressively extended local admission patch.
  • Default twelve SMC die keys and macsmc_soc_die, without a soc_die_keys= override; six CPU thermal zones and both cooling-cluster bindings verified.

Version boundary: these patches/tests are for 7.1.12. The #146 author's latest comment identifies the newer Asahi 7.2.10 implementation at 1b4997bbab62, where t8122_start.rs no longer exists. Our patch has not been ported to or hardware-tested on that implementation. Its current admission policy needs checking before carrying any old change forward.

Local change and operating points

The full state-8 delta changes four Rust files: admission allows states 6–8 only with asahi.m3_thermal=on, rejects those ceilings with Off/Hold, and rejects states 9+. Missing or unusable feedback remains the production governor's responsibility and falls back to state 2. Production thermal-policy logic and firmware-derived frequency/voltage tables were not changed; policy-test coverage was extended. Local and cross-build host tests: 61/61 passed.

State Primary / secondary table frequency Core / SRAM voltage
6 1170 / 1053 MHz 860 / 860 mV
7 1278 / 1152 MHz 910 / 910 mV
8 1338 / 1204 MHz 935 / 935 mV

1338 MHz is the highest operating point in this machine's firmware-provided table, cross-checked against its Apple ADT voltage-state data. It is not a direct macOS clock measurement. Firmware peak-state telemetry reached each tested ceiling; instantaneous MHz telemetry reads zero/unavailable. MHz here refers to the configured firmware table entry.

Test policy: boot state 2 / 618 MHz, active governor, hot threshold 75°C; existing cool threshold 65°C and critical threshold 83°C retained. Ceilings were selected explicitly for each experimental build.

Performance and qualification results

Identical shader binary/settings (gpu-heat 20 1920 1080 128), 5-second warm-up then three 20-second measurements, on battery, with Chromium absent or briefly paused and resumed:

Ceiling Three runs (FPS) Mean FPS Sampled benchmark die peak
6 / 1170 MHz 165.9, 165.7, 165.6 165.73 56.807°C
7 / 1278 MHz 177.2, 179.8, 179.3 178.77 56.726°C
8 / 1338 MHz 187.3, 187.1, 189.8 188.07 55.934°C

Approximately +7.9% from state 6 to 7, and +5.2% from 7 to 8 in this workload. These span separate boots and different kernel images, with the same configuration/workload; they are small synthetic comparisons, not general desktop, efficiency or same-image controlled claims.

  • State 6: 900-second GPU load passed at 166.6 FPS, native die peak 67.995°C, no observed cap reduction or GPU fault. Browser WebGL/video checks passed; video decoding was software. One actual s2idle/resume cycle and subsequent 90-second GPU load passed. This did not qualify long sleep, repeated resume, sleep energy or lock-screen security.
  • State 7: short benchmark and 90-second load passed; native load peak 58.927°C. Live critical/invalid fallback and recovery passed. Longer load/browser/resume qualification was not run at this state.
  • State 8: benchmarks and bounded loads passed. In the complete fallback trial, simulated 84°C and invalid 1°C each forced 8 → 2, followed by 2 → 3 → 4 → 5 → 6 → 7 → 8 after clearing emulation. There were 52 sampled seconds of fallback/recovery observations within a successful 90-second load; native input was restored. OpenGL/Vulkan, Wi-Fi, zram and module checks passed afterward, without observed GPU faults/timeouts.
  • Native hot response at state 8: after emulation was cleared, physical SoC die Tp0b reached 81.224°C; the governor stepped 8 → 7 → 6 → 5 → 4 at native 81.2/78.2°C. A search-indexing process was observed using substantial CPU afterward; its contribution was not isolated. This establishes an observed native hot step-down, not sustained 1338 MHz operation. Earlier standalone 90/120-second loads peaked at 57.322/60.543°C.

Earlier fallback-runner attempts were incomplete because authentication delayed the workload or the privileged-to-user launch lost the experimental Mesa environment. They are not counted as passing trials; native temperature input was restored after each attempt. The final complete trial supplied the verified environment and started its workload after authentication.

A later consolidated local kernel, 7.1.12-2-20261020.1-j613-unified-ARCH, also booted with this GPU delta: hardware graphics checks and a 30-second GPU load passed, firmware peak state 8 observed, die peak 56.425°C. It includes additional display/camera patches and is only an integration smoke test, not a replacement for the separate-build measurements above.

Remaining work

  • Inspect current upstream GPU admission/thermal behavior and agree the appropriate change with maintainers; port only what is still needed.
  • Re-run host tests and hardware qualification on that exact base with recorded patch/config provenance.
  • Longer state-8 GPU and combined CPU/GPU loads, including repeated native hot regulation and recovery.
  • State-8 browser/video and repeated/long suspend-resume testing.
  • Sensor calibration/disconnection, firmware failure paths and broader workload coverage. Host tests cover missing/invalid/stale/stuck input; this is not physical sensor-failure qualification.
  • Review the still-experimental GPU power model; no per-watt or memory-bandwidth bottleneck claim is established.

J615, other GPU core counts and newer firmware profiles are not qualified by these results.

Evidence and patch

The patch below is the exact local delta on release 20 + #135 + #146, provided for review rather than application to the current upstream tree. No firmware images, raw device trees or calibration data are attached.

Prepared and tested with Codex assistance. Gary operated the laptop and authorized the work.

Exact experimental state-8 admission and tests patch (173 lines)
--- a/drivers/gpu/drm/asahi/m3_adt_config.rs
+++ b/drivers/gpu/drm/asahi/m3_adt_config.rs
@@ -322,6 +322,13 @@
             },
         };
         storage::validate_iomaps(iomaps).map_err(|_| EINVAL)?;
+        if let Some(e) = experiment {
+            let thermal_on = m3_params::thermal_param().unwrap_or(ThermalMode::On) == ThermalMode::On;
+            if !crate::t8122_knobs::thermal_mode_allows_cap(e.pstate_cap(), thermal_on) {
+                dev_err!(dev, "M3 G15G: states six through eight require asahi.m3_thermal=on; not starting firmware\n");
+                return Err(EINVAL);
+            }
+        }
         let images = build_images(dev, firmware, soc, experiment, t6031, iomaps)?;
         let hwdata = images.get(HWDATA).and_then(|i| i.as_deref()).ok_or(EINVAL)?;
         let pstates = PstatePolicy::new(
--- a/drivers/gpu/drm/asahi/m3_thermal_policy.rs
+++ b/drivers/gpu/drm/asahi/m3_thermal_policy.rs
@@ -316,9 +316,9 @@
 
     #[test]
     fn t8122_higher_ceilings_keep_state_two_fallback() {
-        for ceiling in 1..=5 {
+        for ceiling in 1..=8 {
             assert_eq!(safe_cap(ceiling, true, 5), ceiling.min(2));
-            assert_eq!(safe_cap(ceiling, false, 5), ceiling);
+            assert_eq!(safe_cap(ceiling, false, 5), ceiling.min(5));
         }
         assert_eq!(safe_cap(8, false, 5), 5);
     }
@@ -361,3 +361,55 @@
         assert_eq!(p.cap(), 2);
     }
 }
+
+#[cfg(test)]
+mod higher_state_feedback_tests {
+    use super::*;
+    fn temp(mc: i32, at: i64) -> Reading { Reading::Temp { mc, at, zones: 1 } }
+    fn raised(ceiling: u32) -> Policy {
+        let mut p = Policy::new(true, safe_cap(ceiling, true, 5), ceiling, 75_000);
+        assert_eq!(p.cap(), 2);
+        let _ = p.update(0, Reading::None);
+        assert_eq!(p.cap(), 2);
+        for step in 0..(ceiling - 2) {
+            let now = i64::from(step) * 2 * S;
+            let _ = p.update(now, temp(50_000 + step as i32 * 100, now));
+        }
+        assert_eq!(p.cap(), ceiling);
+        p
+    }
+    #[test]
+    fn critical_missing_invalid_stale_and_stuck_readings_restore_two() {
+        for ceiling in 6..=8 {
+            for reading in [temp(83_000, 12*S), Reading::None,
+                Reading::Failed { errno: -19, at: 12*S }, temp(1_000, 12*S),
+                temp(126_000, 12*S), temp(50_000, 0)] {
+                let mut p = raised(ceiling);
+                let _ = p.update(12*S, reading);
+                assert_eq!(p.cap(), 2);
+                for step in 0..(ceiling - 2) {
+                    let now = (14 + 2*i64::from(step))*S;
+                    let _ = p.update(now, temp(51_000 + step as i32 * 100, now));
+                }
+                assert_eq!(p.cap(), ceiling);
+            }
+            let mut p = raised(ceiling);
+            let _ = p.update(71*S, temp(50_000 + (ceiling-3) as i32*100, 71*S));
+            assert_eq!(p.cap(), 2);
+        }
+    }
+    #[test]
+    fn hot_steps_down_and_hold_never_leaves_two() {
+        for ceiling in 6..=8 {
+            let mut p = raised(ceiling);
+            let _ = p.update(12*S, temp(75_000, 12*S));
+            assert_eq!(p.cap(), ceiling-1);
+            let mut p = Policy::new(false, safe_cap(ceiling, true, 5), ceiling, 75_000);
+            for step in 0..8 {
+                let now = step*2*S;
+                let _ = p.update(now, temp(50_000 + step as i32*100, now));
+            }
+            assert_eq!(p.cap(), 2);
+        }
+    }
+}
--- a/drivers/gpu/drm/asahi/t8122_knobs.rs
+++ b/drivers/gpu/drm/asahi/t8122_knobs.rs
@@ -27,10 +27,17 @@
 pub(crate) const UNIT_MASK_B_LIMIT: u64 = 0x7;
 /// The default performance-state ceiling: the lowest two states.
 pub(crate) const PSTATE_CAP: u32 = 2;
-/// The highest performance-state ceiling the experiment accepts. The same as the driver's own
-/// limit when the fast-die temperature controller is off (`m3_adt_config::ADT_MAX_PSTATE_LIMIT`):
-/// J613/J615 have no SoC die temperature zone yet, so there is no thermal feedback above it.
-pub(crate) const PSTATE_CAP_MAX: u32 = 5;
+/// Preserve the existing ceiling unless active thermal feedback is selected.
+pub(crate) const PSTATE_CAP_NO_FEEDBACK_MAX: u32 = 5;
+/// Admit native states six through eight for the feedback-controlled experiment.
+pub(crate) const PSTATE_CAP_MAX: u32 = 8;
+
+/// Admission before generating InitData. States six through eight require the active governor;
+/// missing or unusable feedback is still handled by its state-two fallback.
+pub(crate) fn thermal_mode_allows_cap(cap: u32, thermal_on: bool) -> bool {
+    (1..=PSTATE_CAP_MAX).contains(&cap)
+        && (cap <= PSTATE_CAP_NO_FEEDBACK_MAX || thermal_on)
+}
 
 /// Parse a decimal or `0x`-prefixed hexadecimal `u64`. A leading sign is not accepted.
 fn number(text: &str) -> Option<u64> {
@@ -197,7 +204,7 @@
         .ok_or(refuse("t8122_unit_mask_b", "nonzero, no bits outside 0x7"))? as u32;
     let pstate_cap = given(raw.pstate_cap, PSTATE_CAP as u64)
         .filter(|v| (1..=u64::from(PSTATE_CAP_MAX)).contains(v))
-        .ok_or(refuse("t8122_pstate_cap", "1 to 5"))? as u32;
+        .ok_or(refuse("t8122_pstate_cap", "1 to 8"))? as u32;
     Ok(Values {
         initdata_version,
         fender,
@@ -286,7 +293,7 @@
             (|r| r.unit_mask_b = parse_number("0xf"), "t8122_unit_mask_b"),
             (|r| r.unit_mask_b = 0, "t8122_unit_mask_b"),
             (|r| r.pstate_cap = 0, "t8122_pstate_cap"),
-            (|r| r.pstate_cap = 6, "t8122_pstate_cap"),
+            (|r| r.pstate_cap = 9, "t8122_pstate_cap"),
             (|r| r.pstate_cap = 16, "t8122_pstate_cap"),
             (|r| r.pstate_cap = parse_number("-1"), "t8122_pstate_cap"),
         ];
@@ -296,14 +303,30 @@
     }
 
     #[test]
-    fn pstate_cap_accepts_one_to_five_only() {
+    fn pstate_cap_accepts_one_to_eight_only() {
         for cap in 1..=PSTATE_CAP_MAX {
             assert_eq!(resolve(&with(|r| r.pstate_cap = u64::from(cap))).unwrap().pstate_cap, cap);
         }
-        for cap in [0u64, 6, 8, 15, 16] {
+        for cap in [0u64, 9, 15, 16] {
             assert!(resolve(&with(|r| r.pstate_cap = cap)).is_err(), "cap {cap}");
         }
-        assert_eq!(PSTATE_CAP_MAX, 5);
+        assert_eq!(PSTATE_CAP_MAX, 8);
+    }
+
+    #[test]
+    fn states_six_through_eight_require_active_thermal_feedback() {
+        for cap in 1..=5 {
+            assert!(thermal_mode_allows_cap(cap, false));
+            assert!(thermal_mode_allows_cap(cap, true));
+        }
+        for cap in 6..=8 {
+            assert!(!thermal_mode_allows_cap(cap, false));
+            assert!(thermal_mode_allows_cap(cap, true));
+        }
+        for cap in [0, 9, 16] {
+            assert!(!thermal_mode_allows_cap(cap, true));
+            assert!(!thermal_mode_allows_cap(cap, false));
+        }
     }
 
     #[test]
--- a/drivers/gpu/drm/asahi/t8122_start.rs
+++ b/drivers/gpu/drm/asahi/t8122_start.rs
@@ -16,7 +16,7 @@
 //! | `asahi.t8122_sgx_setup` | `t6030`: SGX+0xd14000 = 0x70001 | `none` |
 //! | `asahi.t8122_unit_mask_a` | `0x700000003` | nonzero, within `0x700000003` |
 //! | `asahi.t8122_unit_mask_b` | `0x7` | nonzero, within `0x7` |
-//! | `asahi.t8122_pstate_cap` | `2` | 1 to 5 |
+//! | `asahi.t8122_pstate_cap` | `2` | 1 to 8; states 6 through 8 require `asahi.m3_thermal=on` |
 //!
 //! The defaults are the T8122 table's values. A parameter given with a value it does not accept
 //! refuses the start. Without `asahi.t8122_start=1` nothing here runs, and T8122 is refused.

Activity

  1. garymeyerca commented on Oct 25, 2026

    @garymeyerca
    Author

    Follow-up qualification on the same 8-core J613 / G15G C0, current14 firmware profile, experimental kernel 7.1.12-ARCH-g15-j613-test2, and isolated Mesa 26.3.0-devel prefix:

    One-hour state-8 mixed load: PASS

    vkmark ran continuously on Honeykrisp while the guarded harness repeated dependent compute, rendering, and small direct-compute submission phases for 3,623.58 seconds.

    • 85/85 samples: exact render and compute readback
    • 85/85: fault-free, thermally safe, and firmware state 8 / 1338 MHz reached
    • 14,359 independent die-temperature reads, zero read errors
    • maximum die temperature: 55.980 C
    • whole-window kernel scan: no GPU/MMU fault, timeout, receipt failure, recovery, over-cap, warning, oops, or hung-task signature
    • vkmark remained active, produced no stderr, and completed normally (final score 498)

    The harness's median throughput index was 10,777.666 under deliberate contention with vkmark; this is not comparable to the standalone performance baseline.

    Suspend/resume: FAIL

    A fresh pre-suspend full sample passed exact readback, fault, thermal, and state-8 gates (throughput index 14,562.525; peak 48.635 C). The Air then entered s2idle and became unreachable.

    RTC wake is not exposed on this kernel. Ethernet and Wi-Fi magic wake and their USB/PCI parent wake paths were enabled, with repeated wake packets sent from two wired hosts; they did not wake the machine. After a physical wake event, the Air performed a fresh boot rather than resuming:

    • boot ID changed;
    • last -x records the experimental-kernel session as crash;
    • the persistent unified recovery kernel booted automatically;
    • Btrfs performed tree-log replay, confirming an unclean restart;
    • no pstore record or GPU devcoredump survived.

    The final previous-boot journal was unavailable after the unclean restart, so this evidence does not identify the failing component or prove the GPU caused the restart. It establishes only that this exact experimental-kernel boot does not survive the tested s2idle cycle. No post-resume GPU claim can be made.

    The temporary wake settings were restored. The recovery system is writable and healthy, Btrfs device error counters are all zero, and the current kernel log has no GPU/MMU/Btrfs/oops/panic fault. Raw sample, temperature, vkmark, and kernel-window evidence plus checksums are preserved locally and off-machine.

    Testing and evidence review were performed with Codex assistance at Gary's request.

  2. freber commented on Nov 13, 2026

    @freber

    The 15-inch Air (J615) has no SoC die zone today, since macsmc-hwmon has no board entry for it. #464 adds the J613's twelve die keys for the J615. With them the governor reads macsmc_soc_die on my J615 (MacBook Air 15-inch M3, 10 GPU cores, linux-aurora 7.2.11.aurora16-1, OS firmware 14.7, system firmware 26.6.2). It's running at asahi.t8122_pstate_cap=5 now with 58 to 70 C at idle and light use.

    I haven't run states 6 to 8, because the current admission refuses anything above 5. Once a port of the state-8 admission lands on the 7.2 base, I'm happy to run the same gpu-heat sequence on the J615 and post the numbers here for comparison with the J613 results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions