Skip to content

thermal: of: confirm a critical trip over consecutive samples (J616s CPU zones: 3) - #908

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
thermal/critical-samples
Nov 3, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
thermal/critical-samples

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #907 (#907). Today a critical trip acts on the first reading at or above it, so one noisy sample can shut the machine down. The J616s SMC die maxima move by 9-10 C between 1 s samples under a mixed load.

Changes

  • thermal: of: critical-samples for polled zones.
    • The core acts on a critical trip only after that many consecutive updates read at or above it, and only once per excursion. A reading below the trip resets the count.
    • Unchanged without the property or with 1. Zones that aren't polled also keep acting on the first reading.
    • The counting is a helper in thermal_core.h, covered by KUnit (CONFIG_THERMAL_CRITICAL_SAMPLES_KUNIT_TEST, 5 cases).
    • The binding documents the property and requires polling-delay when it's set.
  • arm64: dts: apple: t604x-j614-j616: critical-samples = <3> on the 17 CPU zones, so critical (125 C) acts after about 3 s at or above it.

Tested

  • KUnit: thermal_critical_samples 5/5 pass (kunit.py, arm64, qemu).
  • The j616s and j614s DTBs build. The only DTB change is the 17 critical-samples properties.
  • J616s one-shot with kernel 7.3.0-aurora-thermcrit1 (fleet15 tree + arm64: dts: apple: t604x-j614-j616: leave fast thermal control to the PMP, critical at the ADT limit #907 + this PR, fleet15 recipe and config) and Stage 2 ec7e1217 with this PR's DTB. For the sustained test only, that DTB also had a test-only critical-action = "reboot" on cpu-e0-thermal, which is not part of this PR.
    • The property is parsed: /proc/device-tree/.../critical-samples = 3, and the zones read 75/115, hot 120, critical 125.
    • 30-min combined load (stress-ng cpu/vm/matrix/io + glmark2 loop + ANE loop): PASS, 1800 s, no hot or critical event.
      • TCMz mean 112.0 C, p99 116.8 C, max 117.3 C. No sample at 120.
      • Fans 3376/3646 rpm.
      • glmark2 median 6322 over 60 runs. ANE MobileNet p50 median 0.575 ms, 88/88 PASS.
    • Sustained critical still trips:
      • With the E cores loaded, I set cpu-e0-thermal's critical trip in sysfs to 45 C while Tex0 read 48.1 C and held there.
      • The write itself triggers an update that reads above the trip, and the zone did not act on it. It acted 2.05 s later, on the third consecutive update: [2067.232] thermal thermal_zone2: cpu-e0-thermal: critical temperature reached, then HARDWARE PROTECTION reboot.
      • The machine came back on its default kernel and Stage 2.
    • -p3 0, Enforcing, no new AVC. One trial boot hit the ANE boot-time stall (stage program failed after RUN, error -110). The same stall shows on stock fleet15 boots, so I re-ran that boot.

🤖 Generated with Claude Code

A critical trip acts on the first reading at or above it. Some sensors
read a hot spot that follows power within a second: the SMC die maxima
of the Apple M4 Pro move by 9-10 C (one standard deviation) between
1 s samples under a mixed load, so one reading can shut the system down
while the die is well within its limits.

Add a critical-samples property for polled zones. With it, the core
acts on a critical trip only once that many updates in a row have read
at or above it, once per excursion; a reading below the trip starts the
count again. A sustained excursion still shuts down, after about that
many polling periods. Without the property, or with 1, nothing changes.
A zone that is not polled cannot count updates and keeps acting on the
first reading.

The counting lives in a helper in thermal_core.h, which KUnit tests
cover: first-sample behaviour, a confirmed run acting once, single
excursions among lower readings never acting, re-arming after a drop
and counter saturation.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The CPU zones' SMC sensors move by 9-10 C between 1 s samples under a
mixed load. Their critical trip is now at the ADT per-sensor maximum of
125 C, but a single reading should still not shut the machine down.

Set critical-samples = <3> on the 17 CPU zones: the critical trip acts
after three consecutive readings at or above 125 C, about 3 s at the
1 s polling the zones already use; the PMP's fast loop and the
hardware's sochot protection stay in front of it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide marked this pull request as ready for review November 3, 2026 16:08
@RyanTheTide
RyanTheTide merged commit a5bc9ed into integration/aurora Nov 3, 2026
@RyanTheTide
RyanTheTide deleted the thermal/critical-samples branch November 3, 2026 16:09
RyanTheTide added a commit that referenced this pull request Nov 3, 2026
Brings in #908 (thermal_of critical-samples property and the J616s DT) so
the J616s run and the merge cover the final tree.

Signed-off-by: Ryan Murray <[email protected]>
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.

1 participant