Skip to content

thermal: apple-pmp: find the T8132 clusters from the cores' nodes - #2234

Open
DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
j773g/pmp-thermal-clusters-20261119
Open

DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
j773g/pmp-thermal-clusters-20261119

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

apple-pmp-thermal checked each cpufreq cluster against fixed logical CPU masks, with a J773g override (P cores 0 and 3-5). Linux numbers CPUs from the boot CPU and the device-tree order, so the masks depend on the boot path. On a J773g booted through aura, the P cluster is CPUs 0 and 7-9 and the E cluster is 1-6. The override doesn't match, and setup fails:

apple-pmp-thermal: setup failed: -22; cpufreq ownership retained

That leaves the Mac mini with no thermal zone, no cooling devices and no measured-rail power budget.

This builds each cluster's members, and the CPU that names its policy, from the cores' own compatibles (apple,donan-p, apple,donan-e), so they no longer depend on the numbering.

Testing

Measured on the owner's Mac mini J773g (Mac16,10), 2026-11-19. The kernel was 7.3.0-ARCH-m4drv2 = m4mini/gpu-test e083527 (9125b31 + #1898 + #1191) + this commit + the J773g jack, Bluetooth and #1192 commits. It booted through aura with the J773g DT.

  • Before (linux-aurora 7.3.0-1-40, same boot path): apple-pmp-thermal: setup failed: -22; cpufreq ownership retained, /sys/class/thermal empty. cpufreq policy0 = CPUs 0 7 8 9 (P), policy1 = CPUs 1-6 (E). The M4 GPU lane also saw the G16 cooling device held at 8 (GPU limited to S1, 338 MHz) with this failure.
  • After: apple-pmp-thermal: T8132 provisional policy: ..., zone apple-pmp-die at 48.75 C, cooling devices cpufreq-cpu0 0/19 and cpufreq-cpu1 0/7, scaling_max_freq P 4104000 and E 2892000 (the hardware maxima).

The file is identical on integration/aurora 0abc2f3 and on the tested base. checkpatch --strict is clean.

Assisted-by: LLM (Gemini:4 Neon)

The policy checked each cpufreq cluster against fixed logical CPU masks,
with a J773g override (P cores 0 and 3-5). Linux numbers the CPUs from
the boot CPU and the device tree order, so the masks depend on the boot
path: on a J773g booted through aura the P cluster is CPUs 0 and 7-9 and
the E cluster 1-6, the override's masks do not match, and the setup fails
with -EINVAL ("apple-pmp-thermal: setup failed: -22"), leaving the Mac
mini with no thermal zone, no cooling devices and no rail power budget.

Build each cluster's members, and the CPU that names its policy, from the
cores' own compatibles (apple,donan-p and apple,donan-e) instead.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

GPU effect, measured by the M4 mini GPU lane on the same Mac mini with this commit on its G16 kernel (m4gpu1 = #1191 + a J773g 25G83 fwid entry + this commit):

  • Before: aurora-g16g cooling device at 8, M4 cooling: ... limit=S1, so the GPU was held at its lowest state (338 MHz).
  • After: the apple-pmp-die zone registers, aurora-g16g cooling goes to 0/8 and the GPU ceiling reaches S9 19.6 s after boot. P/E max are 4.104/2.892 GHz.
  • glmark2 off-screen went from 412 to 453.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

No blockers.

This replaces a board check (of_machine_is_compatible("apple,j773g")) and fixed logical-CPU masks with membership read from each core's own node, which is the right source. Checked drivers/thermal/apple-pmp-thermal.c at the head: apple_pmp_cluster_members() fails closed (-ENODEV without a CPU node; -EINVAL for a core that is neither or both types, a CPU number >= BITS_PER_LONG at line 705, or an empty cluster), it runs before any state is set up so the early return needs no cleanup, and apple_pmp_add_cluster() still cross-checks each mask against the cpufreq policy's related_cpus, so a DT that disagrees with cpufreq is refused rather than half-registered.

The PR body ends with the "Generated with Claude Code" line rather than an Assisted-by: LLM (...) line.

HW row: an M4 MacBook Air (J713 or J613) on the same kernel and default command line: apple-pmp-die registered, cpufreq-cpu<P>/cpufreq-cpu<E> cooling devices present with the policy CPUs printed, scaling_max_freq at the hardware maxima at idle; and for both Macs the regression summary (0 AVC denials, 0 failed units, 0 new kernel errors).

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