Skip to content

thermal: apple-pmp: ride out long dark spans while the SoC is idle - #2720

Closed
RyanTheTide wants to merge 3 commits into
djdev/t8132-pmp-272from
j713/pmp-idle-dark-hold
Closed

RyanTheTide wants to merge 3 commits into
djdev/t8132-pmp-272from
j713/pmp-idle-dark-hold

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

This is the idle dark-span hold for the M4 Air (J713) on the macOS 27.2 firmware. It is one commit, stacked on #2533 (head 12aea2b), which no longer carries it.

With #2533 alone, an idle J713 stays on the minimum CPU caps. Its sensors go dark much longer than the 2 s hold, so every long span returns -61 and brings the caps back. The hardware row is in #2533 (comment): 462 -61 in 150 s, and cpu0 delivered 903 MHz.

The commit holds the last cool reading for up to 30 s, but only while the SMC's measured P+E+GPU rails, read within the last 1.5 s, total under 500 mW. The 2 s hold and every other limit stay as they were. On Macs with a fan, #2533 turns off the rail budget, so no rail reading is recorded there and only the 2 s hold applies.

The same code (identical diff) is in the J713's default kernel today: 0 -61, caps 4464000/2892000, and the clocks reach every OPP. It also passed fanless all-core soaks of 10 and 30 min and 75+ warm reboots.

Numbers and method
  • Dark spans on 27.2, idle, sampled at 100 ms for 120 s:
    • 86% of samples were all-dark.
    • 53 spans, mean 1.9 s, max 13.3 s.
  • A/B on the same kernel, only apple-pmp-thermal.ko changed:
  • Residual, which errs on the safe side: when a heavy load starts or stops, all six sensors can go dark with the last reading above 90 C while the rails are still busy. The hold doesn't apply then, so the minimum caps come back for 2-3 s.
  • Built on 12aea2b with W=1 (no warnings); checkpatch --strict is clean.
  • Merge order: retarget this PR to integration/aurora before M4 PMP: fan-based rail budget and self-described 27.2 PMP path #2533 merges. Deleting the base branch would otherwise close it.

Assisted-by: LLM (Claude:Opus 5.5)

DjDeveloperr and others added 3 commits November 21, 2026 10:49
The M4 PMP session's pieces, its power-vote bridge, its telemetry and
thermal policy and the PMP report's readiness, run only on the Airs and
on macOS 26.6.2 firmware: apple_t8132_firmware_path() compares the boot
loader's os-fw-version with "26.6.2". On the M4 Mac mini (J773g) on
macOS 27.2 there is then no thermal zone, no telemetry, and no vote
bridge, so the G16 driver's apple_pmp_j713_gpu_prepare() refuses the
PMP session and the GPU can't come up.

None of these pieces depends on the OS firmware's version any more.
Each takes what it needs from the PMP firmware itself:
- the data segment from the image's header, which the PMP driver now
  checks at probe;
- the temperature records by name;
- the IOP power handshake the firmware starts;
- each registry entry's length as the firmware registered it.
The vote bridge still checks its soc-device record in the firmware's
tunables.

Add apple_t8132_pmp_path(), every T8132 Mac, and use it for those pieces
in place of the version gate. apple_t8132_firmware_path() stays for the
display, DART, PMGR and boot-handoff paths, which this does not touch.

Signed-off-by: Diljit Singh <hey@djdev.me>
…M4 firmware

t8132_platform_handoff() returns early unless the boot loader reports
macOS 26.6.2 firmware, or the Mac is an Air. On other firmware, macOS
27.2 among them, it applies neither of its two parts:
- The PMGR ownership policy. Without it Linux owns every power domain in
  the board tree, with auto-PM written to each one at probe, including
  the domains 26.6.2 keeps firmware-owned (AIC, GPIO, display) or out of
  Linux's reach. On the M4 Mac mini (J773g) on 27.2 that ends in an
  SError when the PCIe controller probes.
- The memory nodes (MCC, PMC and CLPC) for a loader tree that lacks
  them. They depend on the PMP path, which now runs on every M4
  firmware.

Both describe the SoC, not one firmware, and the copy adds only nodes
the loader's tree doesn't have. Apply them on every T8132.

Signed-off-by: Diljit Singh <hey@djdev.me>
On the 27.2 firmware a cool, idle J713 keeps all six PMP sensors invalid
far longer than the 2 s hold sized from 26.6.2 (0.46 s worst case there):
sampled at the driver's own 100 ms, 86% of samples were all-dark and the
longest span was 13.3 s. Each span past 2 s latches the minimum CPU caps
again, and the recovery climbs back over seconds, so the machine spends
most of its time well below its clocks.

Keep going from the last cool reading for up to 30 s, but only while the
SMC's measured P, E and GPU rails, read within the last 1.5 s, add up to
under 500 mW. A dark cluster is powered down; the rail reading is the
independent proof that nothing is drawing power while the sensors are
dark. The 2 s hold and every other limit are unchanged.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

A checklist note on the selection (not a blocker). The firmware-version gate going away is the right direction. Its replacement, apple_t8132_pmp_path() = of_machine_is_compatible("apple,t8132"), still picks by SoC, but the PMP block already names itself:

  • pmp-report.c:705 combines it with of_device_is_compatible(supplier->of_node, "apple,t8132-pmp-v2"), and that check alone decides it. The SoC test can go.
  • apple_pmp_telemetry_retained_board() and the apple_pmp_j713_board() callers (iomfb_m4.c, g16/glue.c, pmp-display.c) could ask whether an available apple,t8132-pmp-v2 node exists. Then another SoC that reuses this PMP block, or a tree without it, picks the right path without a list. The _j713_board name could follow, since it now means "this PMP ABI".
  • In t8132-platform-handoff.c the SoC check matches what the file does (it supplies T8132 nodes), so that one reads fine as is.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #2730. #2533 was force-pushed to d3a8923, so this branch no longer stacks cleanly. #2730 is the same commit, cherry-picked clean onto d3a8923 (W=1 and checkpatch clean). I am not force-pushing this branch.

Assisted-by: LLM (Claude:Opus 5.5)

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.

2 participants