Skip to content

J873g: all CPU performance states under SMC thermal zones (M6 Mac mini) - #1798

Open
sithglan wants to merge 4 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j873-cpu-perf
Open

sithglan wants to merge 4 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/j873-cpu-perf

Conversation

@sithglan

@sithglan sithglan commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Four commits on integration/aurora b10280c04c2d. This is no longer stacked on #1797: the J873g's DT and the T8152 cpufreq support it needs are in integration/aurora now.

Upstream, the J873g (Mac mini M6, T8152) runs both clusters at their two lowest P-states: T8152 keeps the unmanaged ceiling "until cooling is qualified", in Ryan's words in 4c3405d. With needs_thermal_policy and no PMP fast die-temperature loop, the P/M cluster also sits at the fallback limit of 1440 MHz. As a result, a CPU-bound shell loop takes 6.3 s on a P core here, against 1.9 s on the same machine with all states.

This supplies the missing thermal policy the way T8140 got one, with thermal zones and cpufreq cooling:

  1. arm64: dts: apple: j873: SMC temperature sensors and CPU thermal zones. Adds the 125 SMC float temperature channels that read back stable values, and a thermal zone on each of the SMC's CPU die channels: Te* (E cluster) and Tp* (P/M cluster), 30 in all. The J873g ADT's PMP temp-sensor table gives every CPU die sensor a 110 C target and a 125 C maximum: each zone has a passive trip at 110 C, which throttles both clusters, and a critical trip at 125 C. The other 95 channels stay in hwmon without a zone, since the ADT gives them no limit. (Before 11-24 this was a 75 C trip on all 125 channels, replaced by a fifth commit; the two are squashed now, so no commit carries the 75 C trips.)
  2. arm64: dts: apple: j873: all CPU performance states. E up to 2940 MHz and P/M up to 4788 MHz, as the ADT pmgr lists them (voltage-states1/5-sram).
  3. cpufreq: apple-soc: lift the T8152 ceiling where the DT cools the CPUs. T8152 keeps max_unmanaged_pstate and needs_thermal_policy, and a new per-SoC flag (zone_cooling_qualifies) lets a board DT lift both: a cluster whose cpufreq cooling device (the node of policy->cpu) is named in a thermal zone's cooling map runs every state in its table. Any other T8152 tree keeps the ceiling, so the safety net follows the tree instead of the SoC. WFxT is already treated as absent on T8152, so the transition polling is safe.
  4. arm64: dts: apple: j873: describe the CPU clusters and their capacities. A cpu-map with the E, P and M clusters, and capacity-dmips-mhz E 800, P 1024, M 819. Without a cpu-map the arch topology code never reads capacity-dmips-mhz, so every core had capacity 1024 and the scheduler treated the E cores like the P and M cores.

Testing

  • The head 1d2c710dc94c (11-24) squashes the ADT-trip commit into the first one; its tree is identical to the previous head 2682fad382e8. The J873g DTB builds at the first commit alone with W=1 (the tip's 8 GPU reserved-memory unit-name warnings).

On this head (integration/aurora 24dc422773c9 plus these five commits):

  • apple/t8152-j873g.dtb and drivers/cpufreq/apple-soc-cpufreq.o build with W=1 and no warnings (arm64, LLVM 22).
  • Before the squash: scripts/dtc/apple-dt-check.sh 24dc422773c9 <head> (first four commits), and 545caba57ce0 527b92465345 for the ADT trips: 0 new and 0 removed CHECK_DTBS warnings over all 138 Apple DTBs. The DART power-domain check finds 0 new DARTs without one, and ADT coverage is unchanged.
  • tools/asahi/run-host-tests.py: 458 of 459. The one failure, the pmp-floor-tests mutant class-twice, fails the same way on the base and is untouched by this PR.
  • A J873g boot of exactly this head is still to come. The rows below are from the M6's desktop kernel, which carries these same commits on Merge aurora-wip 210c8f6e into integration/aurora (J873g NVMe, 10GbE, power off, USB2, audio) #1797. For the ADT trips, the M6 booted a DTB with the same 30 zones and trips; it differs only in one zone's node name.

Thermal policy (the zones of the first commit), M6 desktop kernel

All 12 CPUs ran stress-ng --cpu 12 --cpu-method matrixprod for 180 s, with the performance governor, sampled every 10 s from t = 10 s:

DT policy fan hottest CPU die, mean / max hottest SMC channel, max P / E clock, mean stress-ng bogo ops/s
75 C passive trip on all 125 channels (the first commit before 11-24) M6 fan control 65 / 79 C 87 C 4256 / 1914 MHz 917
CPU die zones, 110 C passive, 125 C critical (now the first commit) M6 fan control 88 / 90 C 98 C 4788 / 2940 MHz 1305
the same zones held at its 1000 rpm minimum 90 / 90 C 98 C 4788 / 2940 MHz 970
  • The 110 C trip never engaged. The hottest die settled at 90 C with either fan setting. In a 240 s run with 12 shell loops, the die reached 90–91 C and the hottest channel 98–99 C, and both clusters stayed at their top P-state throughout.
  • The fan holding at its minimum, where the SMC's automatic mode leaves it, costs throughput, not safety. The die still settled at 90 C, at the same reported P-states, but the work done dropped by a quarter (a cold 10 s run gives 1321). So the machine limits itself below the P-state the kernel sets.
  • The hottest channel without a zone is TCMb, at 98–99 C. The ADT gives it no limit.
  • The M6 fan control is the userspace controller that drives fan1_target from the hottest zone. With the ADT trips, only the 30 die zones remain for it to read.

M6 rows (macOS 27.2 stub, Linux at EL2; these commits plus #1797 are the M6's default kernel)

  • Both policies come up with schedutil over 20 (P/M) and 7 (E) states. P reaches 4788 MHz and E 2940 MHz. All 125 zones and both cpufreq cooling devices register. The shell loop takes 1.92 s on a P core.

  • 2 minutes of load on all 12 CPUs, sampled every 20 s:

    t (s) hottest sensor P E fan
    0 44 C 4788 MHz 2640 MHz 1000 rpm
    20 68 C 4788 2940 4344
    40 88 C 2640 1152 4900
    60–120 69–77 C 2040–4788 1152–2940 ~4800

    20 s after the load ends, the hottest sensor is back at 46 C. The fan was driven by the M6's userspace fan controller (fan1_target via macsmc_hwmon fan_control=1); without it the passive trips throttle harder.

  • At the 292773f base (2026-11-14, booted through aura's kboot): both policies again come up with 20 and 7 states, up to 4788 and 2940 MHz, and the SMC zones register with their cooling devices.

  • At the 0abc2f3 base (2026-11-18, booted from the ESP with the rebased stack): both policies come up with 20 and 7 states, and the 125 thermal zones register.

  • Clusters and capacities (fourth commit, the same properties added to the M6's boot DTB):

    • cpu_capacity reads E 491, P 1024, M 819, and cluster_id 0/1/2. Before, every core read 1024 and -1.
    • The values come from single-thread loops at each cluster's top P-state with the performance governor: a Python integer loop, zlib, and sort/JSON. M reaches 80 % of P at the same clock; E reaches 48 % at 2940 MHz.
    • Google Maps dragged with a uinput mouse at 2560x1440 (Chromium, frames shown per wp_presentation feedback): 50.6 → 52.7 fps with the performance governor. Firefox: 40.3 → 40.8, unchanged; its Maps workers still fit the E cores by utilization.
    • make CHECK_DTBS=y apple/t8152-j873g.dtb: the same 3 existing schema warnings as before (GPU and its mailboxes), none new. W=1 adds nothing.
  • scripts/dtc/apple-dt-check.sh against integration/aurora 0abc2f3, with Merge aurora-wip 210c8f6e into integration/aurora (J873g NVMe, 10GbE, power off, USB2, audio) #1797 and the stacked J873g PRs: 0 new CHECK_DTBS warnings (8 fewer), and all 21 changed bindings pass dt_binding_check.

  • tools/asahi/run-host-tests.py passes 427/427 (with Merge aurora-wip 210c8f6e into integration/aurora (J873g NVMe, 10GbE, power off, USB2, audio) #1797 and the stacked J873g PRs, on 0abc2f3). checkpatch --strict reports only false positives on the DT syntax.

cc @Acelogic @RyanTheTide @DjDeveloperr @LiamRay10

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from 7ace568 to 2c4f04c Compare November 13, 2026 10:42
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Heads-up: this stack (#1798, #1799, #1800) now conflicts with integration/aurora in drivers/soc/apple/mailbox.c. The conflict comes in through #1797's merge commit a761a62, which brings aurora-wip's T8152 AOP and J873 ANS mailbox matches. It collides with 41c359d and 788441e on integration, which receive the T6050 GPU mailboxes by interrupt.

Could you refresh #1797 onto the current integration/aurora and rebase the three on it? When resolving, please keep those two commits' interrupt-driven receive path as it is. We'll review the listed commits once the stack is mergeable again.

@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto the refreshed #1797 (ceade2e, on integration/aurora 292773f). The branch is now f620497 (was 2c4f04c) and merges cleanly again.

git range-diff shows the three commits unchanged.

The testing lines in the description are updated: apple-dt-check.sh against 292773f shows 0 new CHECK_DTBS warnings (8 fewer) and every changed binding passes, and the host tests pass 323/323, both with #1797 and all three J873g PRs. Not booted on the M6 at the new base yet.

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from f620497 to b15543e Compare November 15, 2026 19:24
@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto the refreshed #1797 (d87e41e, on integration/aurora 514ae1f). The branch is now b15543e (was f620497) and merges cleanly again. git range-diff shows the three commits unchanged.

With #1797 and the three J873g PRs, at 514ae1f: apple-dt-check.sh shows 0 new CHECK_DTBS warnings (8 fewer) and every changed binding passes, and the host tests pass 321/321. The description is updated. Not booted on the M6 at the new base yet.

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from b15543e to 7f45db9 Compare November 18, 2026 15:07
@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto the refreshed #1797 (bbfdefa, on integration/aurora 0abc2f3). The branch is now 7f45db9 (was b15543e) and merges cleanly again. git range-diff shows the three commits unchanged.

Booted on the M6 with the rebased stack: both policies come up with 20 and 7 states, and the 125 thermal zones register. Merged with #2178 into one tree, t8152-j873g.dts needs both #include lines, which is the only overlap with the display and USB4 PRs. DT and host checks are as on #1797.

@RyanTheTide

Copy link
Copy Markdown
Contributor

In apple_mbox_probe() (mailbox.c), a provider with rx_poll_required is refused unless the machine is apple,j873g and its reg equals the hard-coded hw->j873_window. The match data already says the provider is polled. Where the window sits is the device tree's job, so any other board with this mailbox fails to probe for no hardware reason. Keep the size check on the resource and drop the machine and fixed-address checks. Until then this should stay a draft.

@RyanTheTide
RyanTheTide marked this pull request as draft November 20, 2026 23:55
@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from 7f45db9 to d9642e6 Compare November 21, 2026 01:02
@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide right. That check came from the stale aurora-wip base this branch was still on, not from this PR's three commits. #1797 already removed it (ec172bbcc1ed): the T8152 mailboxes run on their IRQs, and there is no polled profile, j873_window or machine check.

I rebased the three commits onto #1797's head. The head is now d9642e6ae90c, and the PR's diff has no j873_window or rx_poll_required left. The commits themselves are unchanged (git range-diff shows = for all three).

Checks: t8152-j873g.dtb and apple-soc-cpufreq.o build with W=1 and no warnings, and the dt-check against #1797's head reports 0 new and 0 removed warnings over 137 DTBs. The PR stays a draft until #1797 is in, since it is stacked on it.

@sithglan

Copy link
Copy Markdown
Contributor Author

I added a fourth commit, 0be239533807, "arm64: dts: apple: j873: describe the CPU clusters and their capacities".

The J873g had no cpu-map. Without one, capacity-dmips-mhz is never parsed, so every core read capacity 1024 and the scheduler treated the E cores like P and M. The commit adds the E/P/M cluster map and the capacities E 800, P 1024, M 819, measured on the M6. The resulting cpu_capacity is 491/1024/819.

The rows are in the description. In short: Chromium Maps drag 50.6 → 52.7 fps, Firefox unchanged, no new CHECK_DTBS or W=1 warnings. The PR stays a draft on #1797.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

RyanTheTide commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Re-read at 0be2395.

  • The mailbox point from the last review is gone: a9b13e8 drops the polled T8152 ANS profile and its apple,j873g check, and 15d5120 describes the ANS mailbox like the J804's.
  • 0be2395 (cpu-map + capacity-dmips-mhz E 800 / P 1024 / M 819, measured on the M6) is the right fix for every core reading 1024, and the description has the rows.

Before this leaves draft: the branch carries bbfdefa, "Merge aurora-wip 210c8f6 into integration/aurora 0abc2f3 for the J873g". Against today's integration/aurora it brings in about 90 commits that aren't part of this PR (T8152 bring-up, J813 audio, aurora-wip sync merges). Many may already be in the tree as cherry-picks (the net diff is 28 files, +3907/-52), but merged as is they all enter integration/aurora's history, and whatever isn't already there lands with no review in this PR. Please rebase so the PR holds only its own commits, and split anything the J873g needs from aurora-wip into its own PR(s) so each can be reviewed.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from 0be2395 to 67242cc Compare November 22, 2026 06:06
@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide rebased as you asked. The PR now holds only its own four commits, on integration/aurora 24dc422773c9. The new head is 67242ccd3c99 (was 0be239533807).

Checks on the new head:

  • apple-dt-check.sh against 24dc422773c9: 0 new CHECK_DTBS warnings.
  • The DART power-domain check: 0 new DARTs without a power domain. This was the failing step before, from the merge.
  • ADT coverage: unchanged.
  • run-host-tests.py: 458 of 459. The pmp-floor-tests mutant that fails also fails on the base.

A J873g boot of exactly this head is still to come. The M6 is in use right now. The description says which rows are from its desktop kernel, which has these same commits on #1797.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, 67242cc is what I asked for: four commits on the current tip, the aurora-wip merge gone.

Two points on the commits themselves, both about thermal safety now that the series stands on its own:

  1. apple-soc-cpufreq.c: the commit removes needs_thermal_policy and max_unmanaged_pstate = 3 for every T8152, while only t8152-j873g.dts gets thermal zones. The comment says "its board DTs throttle the higher states", but any other T8152 tree, today or later, now runs the top P-states with no kernel throttling at all, where before it was capped. Please keep the cap unless the CPU's node is referenced as a cooling device by a thermal zone (that is something the driver can check at probe), so the safety net follows the tree instead of the SoC.
  2. t8152-j873-thermal.dtsi: the 75 °C passive trip on every channel is described as "a conservative policy, not an Apple limit". Throttling below the machine's own limits is safe for the hardware, but it is a fixed number that costs performance (you note the SMC lets the part sit at 93 °C under sustained load), and the rule here is that such thresholds come from the machine. If the ADT or the SMC exposes a CPU temperature limit for this part, derive the trip from it. If it doesn't, please say so in the commit message, and why 75 °C rather than the SMC's own operating point.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from 67242cc to 545caba Compare November 22, 2026 06:14
@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide both points.

1. The ceiling now follows the tree. Head 545caba57ce0. Only the cpufreq commit changed (6545f870cd53, "lift the T8152 ceiling where the DT cools the CPUs"):

  • soc_t8152_info keeps max_unmanaged_pstate = 3 and needs_thermal_policy, as on the base, and gets a new flag, zone_cooling_qualifies.
  • At ->init the driver walks /thermal-zones/*/cooling-maps/* for the node of policy->cpu. That is the node the cluster's cpufreq cooling device is registered for, so it is what a map has to name for a trip to throttle the cluster. Only when it finds it:
    • the cluster is no longer held to max_unmanaged_pstate (an OPP table above state 3 is accepted);
    • needs_thermal_policy stops asking for a fast die-temperature limit.
  • Any other T8152 tree keeps both: a full OPP table without such zones is still refused with "higher P-states require a qualified thermal policy".
  • On the J873g, the maps name &cpu0 (E) and &cpu6 (P/M). Those are the nodes of the two policies' first CPUs: the M6's running kernel shows cpufreq-cpu0 and cpufreq-cpu1 bound as cooling devices, for logical CPU 0 (cpu@10100) and CPU 1 (cpu@0).
  • The driver builds with W=1 and no warnings, and checkpatch --strict is clean.

2. There is a source in the machine, and I'll derive the trips from it. The J873g ADT's PMP node (iop-pmp-nub) has a temp-sensor table that gives every CPU die sensor (the E- and P/M-cluster entries) a 110 C target and a 125 C maximum. Those are the same two records that 5d70ddf used for the M4 Max's die zone. The SMC's own behaviour is no limit: it leaves the fan at 1000 rpm at 93 C.

So the 75 C passive trip on every channel goes. Instead, as on the J614c:

  • a CPU die zone that controls at the ADT target, 110 C;
  • a critical trip at the ADT maximum, 125 C;
  • the other channels report only.

That changes how the M6 runs under sustained load, so I'll measure it before I push: all-core load, fan at the SMC's own control, hottest die reading and clocks over time. The J873g is in use right now, so that row comes later. Until then the thermal commit stays as it is and the PR stays a draft.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Both answers are what I hoped for. 6545f87 keeps the cap and the thermal-policy requirement on every T8152 and lifts them only for a policy whose CPU node a thermal zone's cooling map names, so a tree without zones still refuses the higher states. Taking the trips from the ADT's PMP temp-sensor records (110 °C control, 125 °C critical), as the M4 Max die zone does, replaces the chosen 75 °C with the machine's own numbers. I'll re-read when that commit is up.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch 2 times, most recently from a4baf34 to 527b924 Compare November 22, 2026 10:15
@sithglan
sithglan marked this pull request as ready for review November 22, 2026 10:17
@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide the die-trip commit is up. The new head is 527b92465345; the first four commits are unchanged.

Fifth commit: "take the CPU die trips from the ADT".

  • Zones only on the SMC's 30 CPU die channels: Te* for the E cluster, Tp* for the P/M cluster.
  • Each has a passive trip at the ADT target, 110 C, throttling both clusters through cpufreq cooling as before, and a critical trip at the ADT maximum, 125 C.
  • The other 95 channels stay in hwmon without a zone, because the ADT gives them no limit. The commit message and the dtsi comment say so, and the 75 C wording is gone.

The sustained-load row I promised. All 12 CPUs ran stress-ng matrixprod for 180 s, sampled every 10 s:

DT policy fan hottest CPU die, mean / max hottest channel P / E clock, mean bogo ops/s
75 C on all 125 channels M6 fan control 65 / 79 C 87 C 4256 / 1914 MHz 917
die zones 110 / 125 C M6 fan control 88 / 90 C 98 C 4788 / 2940 MHz 1305 (+42%)
die zones 110 / 125 C held at the 1000 rpm minimum 90 / 90 C 98 C 4788 / 2940 MHz 970
  • The passive trip never engaged. With either fan setting, the dies settle at 90 C under this load, 20 C below the target. A 240 s run with 12 shell loops looked the same: 90–91 C at the top P-states.
  • The fan held at its minimum (the "SMC's own control" case). It is held where the SMC's automatic mode leaves it.
    • I held it with fan1_target, because with fan_control=1 loaded the driver has no way back to automatic mode short of reloading it.
    • The die still settles at 90 C, and the reported P-states stay at the top. The work done drops by a quarter (a cold 10 s run gives 1321), so the machine limits itself below the kernel's P-state there.
    • That costs throughput, not safety.
  • The hottest channel without a zone is TCMb, at 98–99 C in both fan settings.
  • Checks on this head:
    • apple-dt-check.sh 545caba57ce0 527b92465345: 0 new and 0 removed warnings over 138 DTBs.
    • checkpatch --strict is clean.
    • tools/asahi/run-host-tests.py: 458 of 459. The one failure is the same pre-existing pmp-floor-tests mutant class-twice as on the base.
    • The DTB the M6 booted has the same 30 zones and trips as this head's t8152-j873g.dtb. Only one node name differs: this head names the Tp0G zone smc-tp0g-2, because smc-tp0g is taken by Tp0g.

I've updated the description and marked the PR ready for review.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, 527b924 is what I asked for: zones only on the 30 CPU die channels, passive at the ADT target (110 °C) and critical at the ADT maximum (125 °C), the other channels left in hwmon without a made-up limit, and the 75 °C policy gone. The sustained-load table makes the case well: the dies settle around 90 °C under all-core load with the passive trip never engaging, and throughput goes up 42 % against the old policy. Holding the fan at its minimum costs work, not safety. Together with the tree-scoped cpufreq cap from 545caba, this is fine from our side.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from 527b924 to 2682fad Compare November 23, 2026 04:25
@sithglan

Copy link
Copy Markdown
Contributor Author

Rebased onto integration/aurora b10280c (527b924 → 2682fad). The PR conflicted in t8152-j873g.dts with the merged #1797/#1800/#2139 DT.

Resolution (in "SMC temperature sensors and CPU thermal zones"):

  • The m6_smc_hwmon: label goes on the hwmon node, which now follows integration's smc_reboot node.
  • #include "t8152-j873-thermal.dtsi" goes after integration's board includes.
  • The old &dwc3_2_dart override the context carried is gone in integration and stays gone.

Checks:

  • git range-diff: three commits are =. The thermal-zones commit and "all CPU performance states" differ only in context.
  • The J873g DTB builds with W=1, with the same 8 warnings as the tip (the existing GPU reserved-memory unit names).
  • apple-soc-cpufreq.o builds clean with W=1.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formal §1–§6 pre-PR checklist review at 2682fad382e8212081c24c8c03a6c6f84b1062ab.

Checklist Summary

  • §1 No model gating: PASS — driver logic uses SoC match data (soc_t8152_info) and DT topology rather than board/chip/firmware string checks.
  • §2 Production-ready, no hacks: BLOCKER — sustained-load thermal tests were run with macsmc_hwmon fan_control=1 + manual fan1_target rather than the default kernel command line (see Blocker 3).
  • §3 Safety: FAIL (blocking) — apple_soc_cpufreq_zone_cooled() fails open on static DT presence instead of active runtime cooling ownership, and Commit 1 introduces hardcoded 75 °C non-ADT trips before Commit 5 removes them (see Blockers 1 & 2).
  • §4 Clean-room and attribution: PASS — all 5 commits (c86577053a3b..2682fad382e8) carry human author/committer (Thomas Glanzmann) and human Signed-off-by: only with zero AI commit trailers; PR body includes Assisted-by:.
  • §5 Evidence: FAIL (blocking) — CI (dt-checks, host-tests) is green (2/2) and all 30 smc-te*/smc-tp* sensor indices (66..74, 95..115) in t8152-j873-thermal.dtsi match &m6_smc_hwmon child order exactly, but the exact rebased head 2682fad382e8 has not been booted on J873g and no default-cmdline regression row is posted (see Blocker 3).
  • §6 Naming: PASS — no Honeykrisp/hk/Asahi/m1n1 regressions.

Actionable Blockers

  1. §3 Safety — apple_soc_cpufreq_zone_cooled() fails open on static DT text (drivers/cpufreq/apple-soc-cpufreq.c):

    • Unlike T8132 (needs_thermal_owner, which holds FREQ_QOS_MAX at max_unmanaged_pstate until the thermal driver actually binds at runtime and calls apple_soc_cpufreq_set_thermal_owner(policy, true)) and T8140 (needs_thermal_policy, which holds fd->fallback until a live PMP sample confirms thermal control is active), apple_soc_cpufreq_zone_cooled() permanently lifts BOTH max_unmanaged_pstate AND needs_thermal_policy solely because a static /thermal-zones/*/cooling-maps/* DT node references policy->cpu.
    • If CONFIG_THERMAL or CONFIG_CPU_THERMAL is disabled, or if macsmc-hwmon (CONFIG_SENSORS_MACSMC) is not built, fails to probe, or is unloaded, apple-soc-cpufreq still unlocks all 20 P-states up to 4788 MHz with zero active kernel thermal throttling.
    • Additionally, apple_soc_cpufreq_cpu_cooled() only checks whether cooling-device matches policy->cpu — it does not verify IS_ENABLED(CONFIG_CPU_THERMAL), that the referenced trip is a passive trip, or that a live thermal zone and cooling device actually bound to the policy.
    • Please make T8152 fail closed until active thermal cooling is actually bound at runtime (for example, reusing the existing needs_thermal_owner / apple_soc_cpufreq_set_thermal_owner() runtime handoff from the thermal/hwmon side, or verifying live bound passive cooling before releasing unmanaged_cap).
  2. §3 History hygiene — Squash Commit 5 (2682fad382e8) into Commit 1 (c86577053a3b):

    • Commit 1 adds 125 thermal zones with hardcoded 75 °C passive trips explicitly described as a fixed bring-up policy rather than an ADT limit (§3 forbids hardcoded safety thresholds), and Commit 5 deletes 95 of those zones and replaces the remaining 30 with the ADT's 110 °C passive / 125 °C critical limits.
    • Please squash Commit 5 into Commit 1 (before adding the higher OPPs and lifting the ceiling) so no commit in integration/aurora history carries hardcoded 75 °C non-ADT safety trips.
  3. §2 / §5 Evidence — Exact-head default-cmdline boot and regression row on J873g:

    • Neither Commit 5's exact DTB (smc-tp0g-2-thermal) nor the rebased head 2682fad382e8 has been booted on J873g yet (as noted in the PR body).
    • The sustained-load thermal table was collected with macsmc_hwmon fan_control=1 / manual fan1_target rather than the default kernel command line.
    • Please boot the final head SHA on the J873g on the default kernel command line (without fan_control=1), confirm all 30 zones + cpufreq cooling devices bind and sustained load stays safe under automatic SMC fan behaviour, and include the §5 regression row (0 SELinux denials, 0 failed units, 0 new kernel errors).

Non-blocking note

  • The PR description repeats the same 3-bullet cpu_capacity / single-thread loops / Google Maps block twice under M6 rows.

Assisted-by: LLM (Gemini 4 Neon)

Describe the 125 SMC temperature channels that read back stable values
on the J873g. The SMC hwmon node becomes an indexed thermal sensor
provider instead of discovering its temperature keys, so that thermal
zones can refer to the channels, and the CPU nodes become cooling
devices.

Give the SMC's CPU die channels a thermal zone each: Te* for the E
cluster and Tp* for the P/M cluster, 30 in all. The J873g ADT's PMP
temp-sensor table gives every CPU die sensor a 110 C target and a 125 C
maximum, the same two values the M4 Max (J614c/J616c) die zone takes
from its ADT. Each zone has a passive trip at the target, which
throttles both clusters through cpufreq cooling, and a critical trip at
the maximum. The other 95 channels stay reported through hwmon without a
zone, since the ADT gives them no limit. The SMC's fan policy is no
limit either: in its automatic mode it leaves the fan at its 1000 RPM
minimum even at 93 C under sustained full load.

The sensor list is that of Acelogic's J873 bring-up on linux-aurora
j873.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873g exposes only the two lowest performance states per cluster
until its cooling is described. With the SMC thermal zones in place,
add the rest: E up to 2940 MHz (voltage-states1-sram) and P/M up to
4788 MHz (voltage-states5-sram), as the ADT pmgr lists them. opp-level
is the hardware P-state, the table index plus two (the ADT's
cpu-perf-state0-index), as for the two existing states.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
T8152 keeps the ceiling at its two lowest P-states because no thermal
policy had been provided for it, as commit 4c3405d ("cpufreq: apple:
retain the unmanaged P-state ceiling on T8152") put it. Its
needs_thermal_policy, without a PMP fast die-temperature loop
(apple,fast-die-effort, not available on T8152), also holds each cluster
at the fallback limit, a third of its top state: 1440 MHz on the P/M
cluster even with only two states.

The J873g DT now supplies a thermal policy: SMC thermal zones with
passive trips that throttle both clusters through cpufreq cooling. Let a
T8152 board DT qualify the higher states that way. With the new
zone_cooling_qualifies, a cluster whose cpufreq cooling device (the node
of policy->cpu) is named in a cooling map of a thermal zone is no longer
held to max_unmanaged_pstate, and needs_thermal_policy no longer asks it
for a fast die-temperature limit. Any other T8152 tree keeps both: a
board runs the higher states only once its own DT throttles them.

WFxT, which the transition polling would otherwise execute, is already
treated as absent on T8152.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The J873g's CPUs had no cpu-map and no capacity-dmips-mhz. The arch
topology code parses capacity-dmips-mhz only while walking a cpu-map,
so every CPU got capacity 1024 and cluster_id -1. The scheduler then
treats the six E cores like the P and M cores: on the M6 desktop, the
busiest threads of a browser dragging Google Maps run 65-77 % of their
time on E cores.

Describe the three clusters (E: cpu@0-5, P: cpu@10100-10101, M:
cpu@40102-40105, as their MPIDR affinities group them) and give each
core type its single-thread work per MHz relative to a P core. The
values are the mean of three single-thread loops run at each cluster's
top P-state with the performance governor (Python integer loop, zlib
compression, sort/JSON). Relative to a P core at 4788 MHz, M cores
manage 80 % at the same clock, and E cores 48 % at 2940 MHz, which is
78 % per MHz:

  E 800, P 1024, M 819

With these, cpu_capacity reads E 491, P 1024, M 819, and the clusters
show as 0, 1 and 2.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan
sithglan force-pushed the thomas/j873-cpu-perf branch from 2682fad to 1d2c710 Compare November 23, 2026 23:22
@sithglan

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr thanks. One point is done here, one needs a decision, and one needs an M6 boot.

2. History: done. The ADT-trip commit is squashed into the first one; the head is 1d2c710dc94c.

  • No commit carries the 75 C trips now. The first commit adds the 30 CPU die zones with the ADT's 110 C passive and 125 C critical trips, and its message says so.
  • The tree is identical to the previous head 2682fad382e8, and the other three commits are unchanged.
  • The J873g DTB builds at the first commit alone with W=1, with the tip's 8 existing warnings (GPU reserved-memory unit names).
  • The description is updated: four commits, no repeated block under "M6 rows".

1. Fail closed until cooling is bound at runtime. Agreed that DT presence alone shouldn't release the higher states. Here is the shape I'd use:

  • T8152 moves to the existing runtime hand-off: needs_thermal_owner, with max_unmanaged_pstate = 3, in place of the DT-presence lift (zone_cooling_qualifies and apple_soc_cpufreq_zone_cooled() go away).
  • On the J873g the owner is macsmc-hwmon, as apple-pmp-thermal is on T8132:
    • Once its die zones are registered, it hands over each cpufreq policy those zones cool, with apple_soc_cpufreq_set_thermal_owner(policy, true). It checks the zone's cooling map against the policy's CPUs, and that the policy's cooling device is bound to a passive trip of that zone.
    • On remove, it hands them back (false), and the cap returns.
  • Without CONFIG_THERMAL, CONFIG_CPU_THERMAL or CONFIG_SENSORS_MACSMC, or with macsmc-hwmon not bound, nobody hands the policies over and they stay at state 3.

@RyanTheTide this moves the lift out of what you reviewed in 545caba and 527b924, so a quick yes from you on the shape too, before I write it?

3. Exact-head row on the J873g, default command line, without fan_control=1. It needs an M6 boot that I don't have the owner's go for yet. I'll run it on the head with (1): the 30 zones and cooling devices bound, sustained load under automatic fan control, and the §5 counts.

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.

3 participants