Skip to content

cpufreq: apple-soc: offer no boost control without turbo-mode OPPs - #2199

Open
scottjones wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
scottjones:upstream/cpufreq-boost-turbo-only
Open

scottjones wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
scottjones:upstream/cpufreq-boost-turbo-only

Conversation

@scottjones

Copy link
Copy Markdown
Contributor

Since f677f7c ("cpufreq: apple-soc: start with boost enabled"), Macs whose device tree has no turbo-mode OPPs, such as the M3 Air and the MacBook Neo, log Cannot enable BOOST when power-profiles-daemon applies a profile, and power-saver no longer lowers the CPU limit. This leaves .set_boost unset on those SoCs, so no boost file appears. SoCs with turbo-mode OPPs keep boost control, and keep f677f7c's boost-on default.

Tested with this commit on top of integration/aurora 0abc2f3, together with aura main and Mesa aurora-wip:

  • M3 Air (J613), lab job j1118-185603-b25d: no BOOST lines, power-saver caps the P-cores at 2424 MHz (from 4056).
  • MacBook Neo, lab job j1118-185622-b473: no BOOST lines, power-saver caps.
  • 16" M4 Pro (J616s), by hand: boost file present, 4104 MHz on power-saver, 4512 MHz on performance, no errors.

🤖 Generated with Claude Code

Since commit f677f7c ("cpufreq: apple-soc: start with boost
enabled") the driver turns boost on when it registers. On SoCs whose
device tree marks no OPP as turbo-mode, such as the M3 (T8122) and the
MacBook Neo, no policy supports boost. The driver still sets
.set_boost, so the core creates the global boost file anyway, and
enabling it fails:

  cpufreq: cpufreq_boost_trigger_state: Cannot enable BOOST
  cpufreq: store_boost: Cannot enable BOOST!

power-profiles-daemon writes that file when it applies a profile, so on
these Macs it fails, and power-saver no longer lowers the CPU limit.

Leave .set_boost unset when the tree has no turbo-mode OPP, so no boost
file appears there. SoCs with turbo-mode OPPs keep boost control as
before.

Tested on an M3 MacBook Air (J613) and a MacBook Neo: no boost errors,
and power-saver caps the P-cores (J613: 4056 to 2424 MHz). On a 16"
M4 Pro (J616s) the boost file is still there: power-saver runs the
P-cores at 4104 MHz and performance at 4512 MHz.

Assisted-by: Claude:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Scott Jones <scottajones@gmail.com>
@gig3m

gig3m commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Same on the M5 Air (J813, T8142). Its device tree has no turbo-mode OPPs either.

Without this commit, on #2135's merged head 408e27268fd6, power-profiles-daemon logged this at every start:

cpufreq: cpufreq_boost_trigger_state: Cannot enable BOOST
cpufreq: store_boost: Cannot enable BOOST!
power-profiles-daemon: Failed to activate initial profile: Failed to activate CPU driver 'cpufreq': Error writing '/sys/devices/system/cpu/cpufreq/boost': Invalid argument

With this commit on the same base, together with #1906 and CONFIG_ACPI=y:

  • there's no global boost file and no BOOST lines;
  • power-profiles-daemon starts without the error;
  • both clusters keep their full table (P 4464 MHz, E 2964 MHz).

Two real deep sleeps on that boot came back clean.

🤖 Generated with Claude Code

@freber

freber commented Nov 18, 2026

Copy link
Copy Markdown

Claude Code wrote this up from my tests.

Same on the J615 (15-inch M3 Air). Users notice it in the performance profile. Without this commit power-profiles-daemon stops at the boost write and never sets its governor, so the CPUs stay on schedutil whichever profile is picked. On this Mac that made Chromium scroll badly enough that 7.3 looked like a regression against 7.2.

Both kernels are integration/aurora 59b02d5ef with #2145 to #2157, #2090, #1985 and a port of omacom/linux-aurora#410, #491 and #500 on top of #2147. The only difference is this commit.

With it there's no boost file, no BOOST lines and no daemon errors across profile switches.

Profile Governor P-core / E-core limit
power-saver schedutil 2424 / 1476 MHz
balanced schedutil 4056 / 2748 MHz
performance performance 4056 / 2748 MHz

The scroll test is Chromium 156.0.8078.79 full screen on the built-in panel (2880x1864 at scale 1.6), scrolling a 21000 px page with 101 images at 2000 px/s for 20 s. Four runs per kernel, medians, performance profile selected each time.

Without this commit With it 7.2 (omacom aurora16 with my J615 patches)
Dropped frames 8.2 % 0 % 0 %
Frame latency p50 83 ms 34 ms 34 ms
Chromium GPU process CPU per frame 7.5 ms 0.9 ms 1.2 ms
Renderer CPU per frame 4.1 ms 0.5 ms 0.5 ms

Balanced with this commit also runs schedutil. On the same kernel it gave 4.6 % dropped frames (1.8 to 10.6 % per run) at 83 ms p50.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 1.

The change itself is sound: with .set_boost NULL, cpufreq_boost_supported() is false, so the core creates no global boost file (drivers/cpufreq/cpufreq.c:2965), and cpufreq_boost_trigger_state() can no longer return -EOPNOTSUPP from an empty policy loop (cpufreq.c:2831-2850). The decision comes from the DT turbo-mode property, not from a SoC list, which is the right source.

  1. Commit b96b83d carries Assisted-by: Claude:claude-opus-5-5 and Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. Drop both trailers and keep only the human Signed-off-by; put the assistance note as the last line of the PR body (Assisted-by: LLM (<Vendor>:<Model>)) instead of the "Generated with Claude Code" line.
  2. The base has moved: 1135a0a ("arm64: dts: apple: t8122: mark the P-core boost states turbo-mode") is now in integration/aurora, so on T8122 (J613/J615) of_find_node_with_property(NULL, "turbo-mode") (drivers/cpufreq/apple-soc-cpufreq.c:1636) now finds a node and this patch keeps boost control there. The J613 result in the description (no boost file, power-saver at 2424 MHz) was taken before that DT change and no longer exercises the path this commit adds; the M3 mention in the commit message and the comment should be updated, and the no-turbo path is now proven only by the Neo and M5 Air rows. Please rebase and rerun.
  3. Nit: the lookup is tree-wide, so a turbo-mode flag in any non-CPU OPP table would keep the boost file on a SoC whose CPU tables have none. Today all Apple turbo-mode users are CPU tables, so this is fine, but walking the operating-points-v2 tables of the CPU nodes would match what the core actually checks per policy.

HW row: rebased on current integration/aurora, MacBook Neo (no turbo-mode OPPs): no boost file, no BOOST lines, power-profiles-daemon switches all three profiles and power-saver lowers scaling_max_freq; J613 or J615 (turbo-mode OPPs now present): boost file present, 0/1 writes succeed, P-core max follows; both with 0 AVC denials, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

freber added a commit to freber/linux that referenced this pull request Nov 22, 2026
The M3 runtime publishes one render pass at a time unless
asahi.m3_render_batch_size or the writable m3_render_batch_override
asks for more. On a J615 (15-inch M3 MacBook Air) that costs frames
while Chromium scrolls an image-heavy page. Make the boot default 2.

Measured on a J615 with the stock 7.2.11 aurora16 module, whose
next_batch() and render_batch_size() match this tree's, booted with
asahi.t8122_pstate_cap=5 and setting m3_render_batch_override at
runtime. Chromium images scene, median of three runs:

  batch   dropped frames   p99 frame interval
  1       2.2 %            33.3 ms
  2       0 %              16.7 ms
  4       0.1 %            16.7 ms

Two same-session control runs at batch 1 dropped 2.6 % and 2.4 %. With
2, a burst of eight glprobe draws retired 1.6 render commands per
retirement instead of 1.0, its median fell from 4.53 ms to 4.00 ms and
GPU mailbox interrupts per run fell from 320 to 200. gpubench
throughput and idle power stayed within noise. The kernel log had no
GPU errors.

Only T8122 is affected. This parameter exists only with
CONFIG_DRM_ASAHI_M3_T8122, its only reader is the runtime's
next_batch(), the runtime's only SoC table is T8122 and it starts only
on the J613 and J615. T6030 and T6031 keep the G15 backend or the
probe refusal. The first render draw is still published alone for
InitBM, and the T8122 pipeline depth of 2 and the 4000 us batch budget
still bound every batch. m3_render_batch_override=1 restores the old
behaviour at runtime, asahi.m3_render_batch_size=1 at boot.

A 7.3 kernel built from this head with aurora-silicon#1985, aurora-silicon#2199 and aurora-silicon#2203 merged
then booted on a J615 with the default command line. In the same
Chromium scene under the balanced profile at panel scale 1.6, median
of three runs, 11.8 % of frames dropped at the
default of 2 against 15.6 % on the same kernel booted with
asahi.m3_render_batch_size=1. The eight-draw glprobe burst retired
1.52 render commands per retirement against 1.00. The kernel log had
no GPU errors. aurora-silicon#2203 raises that build's ceiling to state 8.

The J613 runs the same runtime and gets the same default but was not
tested. Neither was a 7.3 build at the T8122 ceiling of 2 that
applies without aurora-silicon#2203.

Signed-off-by: Fredrik Silfver <1684291+freber@users.noreply.github.com>
freber added a commit to freber/linux that referenced this pull request Nov 22, 2026
…mplete die key list

States 6 to 8 were reachable only with asahi.t8122_pstate_cap and
asahi.m3_thermal=on. The measured behaviour needed two more boot
parameters. A machine should not need boot options to run as intended.
The behaviour belongs to the hardware description.

Make the ceiling default to 8 on a T8122 whose device tree has a node
with apple,soc-die-keys-complete while the thermal limit is on, which is
the default. The property says that the firmware provides every key in
apple,soc-die-keys. The hwmon driver then registers the macsmc_soc_die
zone only with all of them present. In the tree only the J615 sets it.
J613 and J504 list the same keys through t8122.dtsi but are not
confirmed to provide them all, so they keep the old ceiling of 2. So
does an unset cap with asahi.m3_thermal=off or hold.
asahi.t8122_pstate_cap still sets any ceiling from 1 to 8 and is now
only an override.

The ceiling goes to the firmware in the InitData before the GPU starts,
when the hwmon driver may not have probed yet. So the default follows
the property, not whether the zone exists at that point. The runtime
cap still starts at 2 and falls back to 2. It rises only while the
limit reads a usable temperature from that zone, so a J615 whose zone
did not register stays at 2.

The limit's thresholds follow the same rule. With the property, hot
defaults to 90 C and the cool gap to 3 C. Elsewhere the old 80 C and
10 C stay, so the other M3 boards are unchanged.
asahi.m3_thermal_hot and asahi.m3_thermal_cool_gap are overrides.
Sysfs shows "default" while they are not given.

The choice of 90 C with a gap of 3 C comes from the J615 measurements.

  hot, gap   throughput   sustained 600 s   combined peak
  80, 10     218 fps      80.0 fps          95.8 C
  85, 10     272 fps      79.9 fps          not run
  90, 3      289 fps      88.1 fps          94.4 C
  92, 3      295 fps      95.2 fps          93.9 C

At 90 C with a gap of 3 C a 600 s GPU load held the hottest GPU key at
93.8 C with no missed frames. With a gap of 10 C the cap never left
state 2 under a sustained load, because the die settles a few degrees
under hot but above hot minus 10. The 85 C of the released form gave no
sustained gain while 80 C cost throughput. 92 C is a little faster, but
the GPU keys then reach 95.9 C, above the 94 C GPU die target in the
boot firmware's tree. 90 C is the highest value that stays under it in
the measurements. Critical is then 98 C, below the 110 C trip of the CPU
thermal zones. Critical or any loss of a reading returns the cap to 2.

This was measured on a J615 only, the one board that sets the property.
A 7.3 kernel built from this branch with aurora-silicon#1985, aurora-silicon#2090 and aurora-silicon#2199 merged
booted there with the default command line. The cap rose from 2 to 8
once the die reading arrived and gpubench w4 gave 322 fps. Of three
600 s w10 loads at the default, two ran to the end at 126 and 122 fps
with the hottest die key at 93.0 C. The third stopped at the test's
95 C guard after 416 s when one die reading reached 99.2 C, where the
98 C step returned the cap to 2. A half-second trace of the same jump
on a later load showed a one-second burst on every CPU core, which
lifted the CPU keys by 13 to 16 C while the GPU keys rose about 4 C.
The host tests in tools/asahi/m3-runtime-tests.rs cover the new
defaults and that the old defaults remain without the property.

Signed-off-by: Fredrik Silfver <1684291+freber@users.noreply.github.com>
freber added a commit to freber/linux that referenced this pull request Nov 22, 2026
The 15-inch M3 MacBook Air (J615) has the J613's SoC, DRAM, PMP tables
and PACC0 request layout. Its device tree is a legacy handoff tree. The
report binds the generic "apple,t8122-pmp-v2-report" and names its PMP
with apple,pmp. This driver starts that PMP, which runs the 14.x
firmware (3B18C886-4C70-349B-B1C4-70F35DE2C5CD). Without a memory floor
nothing raises the DRAM or fabric state for the CPUs. A 4-thread membw2
read then reaches 19.8 GB/s.

Give its report apple,cpu-memory-floor = <0x21 2 0x25 4>. The levels
come from the J615 runs of the earlier J615 floor patch, not from the
J613 tree. That patch stored DCS 4 in bits 51:48 and fabric level 2 in
bits 35:32 of the PACC0 request, word 0x2004000200000000. Those are the
lanes of request classes 0x25 and 0x21, so these pairs build the same
word. The 14.x PMP answered it with DVFS-STATE 0x24 within 5.1 ms. That
is class 0x25 at 4 in the low nibble with class 0x21 at 2 in the high
nibble. In one boot it confirmed 39 of 39 raises and 38 of 38 releases.
With the floor the same membw2 read reached 68.2 GB/s. The levels equal
the J613's because the SoC, DRAM and PMP tables are the same, but they
were measured on this board.

The driver needs no change. pmp_floor_probe() runs for any report with
the property. pmp_floor_find_pmp() takes the report's apple,pmp without
an availability check, so it does not matter that the PMP is still
disabled when the report probes. The start work waits for the report to
read READY. It does once the PMP runs, which apple_pmp_start_init()
arranges when the display asks for it. Admission then reads the tables
m1n1 fills in on the PMP node. Run on this board's live tables, the
upstream check admits 2 CPU clients and puts the PACC0 update alias at
+0x10888, where the earlier patch wrote it. pmp_floor_word_of() builds
0x2004000200000000 from the pairs. The binding already allows the
property on apple,t8122-pmp-v2-report.

The generic T8122 report does not set floor_confirm. Raises and
releases are published without the DVFS-STATE check, as on every report
but the J613 25G83 one.

The experimental t8122-j615-25g83 tree includes this file. It binds the
native J613 report, where the floor has not run on a J615. It deletes
the property so that it stays uncovered, as it was before.

Tested by building both J615 trees. Decompiled, the J615 report carries
the property while the 25G83 report has none. pmp-report.o builds with
clang 18. The floor ran on a J615 with the 14.x firmware on a 7.2.11
kernel carrying the earlier patch. A 7.3 kernel built from this tree
with aurora-silicon#2090, aurora-silicon#2199 and aurora-silicon#2203 merged then booted on a J615 with the 14.x
firmware and the default command line. The report admitted the floor
from the property with the PACC0 update alias at +0x10888. During three 4-thread membw2 reads the floor was up,
DVFS-STATE read 0x24 each time and the read reached 69.3 GB/s. The
boot logged no floor fault or refusal. On a later boot of the same
kernel the read gave 21.6 GB/s with the floor's enable attribute at 0
and 69.3 GB/s with it at 1.

Signed-off-by: Fredrik Silfver <1684291+freber@users.noreply.github.com>
@freber

freber commented Nov 22, 2026

Copy link
Copy Markdown

Claude Code wrote this up from my tests.

Here is the J615 half of the HW row on the new base, now that 1135a0a marks the T8122 boost states turbo-mode.

The kernel is integration/aurora 24dc42277 with this PR's head b96b83d10 merged on top. The boost path runs with turbo-mode OPPs present. The same build also carries #2203, #1985 and #2090, plus a LOCAL TEST ONLY commit that keeps the DRM name asahi because my installed Mesa doesn't accept aurora yet. I booted it on the default command line with no aurora.* or pmp_report.* words.

Check Result
P-core turbo-mode OPPs 3720, 3780, 3864, 3960 and 4056 MHz
boost file present, 0 at the start of the test
write 0 reads 0, P-core scaling_max_freq 3636 MHz
write 1 reads 1, P-core scaling_max_freq 4056 MHz
power-saver boost 0, schedutil, P 3636 MHz, E 2748 MHz
balanced boost 1, schedutil, P 4056 MHz, E 2748 MHz
performance boost 1, performance governor, P 4056 MHz, E 2748 MHz
power-profiles-daemon failure lines 0
BOOST kernel lines 0

In my post from 18 November, before 1135a0a, power-saver capped the P cores at 2424 MHz and the E cores at 1476 MHz. On this base power-saver turns boost off, which leaves the P cores at 3636 MHz and the E cores at their full 2748 MHz.

HW row: J615, integration/aurora 24dc42277 with this PR merged, default command line, turbo-mode OPPs present: boost file present, writes of 0 and 1 succeed, P-core max follows (3636 MHz at 0, 4056 MHz at 1); power-profiles-daemon switches power-saver, balanced and performance with 0 failure lines; 0 BOOST lines; 0 AVC denials, 1 failed unit, 2 new kernel errors.

The failed unit is speakersafetyd. My boot loader passes no amp levels, so the kernel turns the speakers off. The two new kernel errors were logged during boot, before the test started. The video encoder finds no preloaded firmware (apple-ave ... no preloaded firmware) and the camera firmware doesn't answer (apple-isp ... never received magic number from firmware). Neither touches cpufreq.

I don't have a MacBook Neo, so the half of the row without turbo-mode OPPs isn't covered here.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J615 half. With turbo-mode OPPs the boost file appears and is honoured both ways (3636/4056 MHz), the PPD profiles switch with no failure lines, and there are no BOOST lines. That covers the turbo side on the default command line. The two boot-time errors are unrelated to cpufreq.

Two things remain. We have a MacBook Neo and will post the other half here: no turbo-mode OPPs, so no global boost file, and PPD switching cleanly. The head is still b96b83d, so the trailer blocker from my last comment stands: the commit still carries Assisted-by: and Co-Authored-By: lines. Please drop both and keep only your Signed-off-by.

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.

4 participants