Skip to content

cpuidle: apple: add T6040 (M4 Pro) with the second state off by default - #371

Merged
RyanTheTide merged 3 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/cpuidle-t6041
Oct 23, 2026
Merged

RyanTheTide merged 3 commits into
aurora-silicon:integration/aurorafrom
jgoyvaerts:m4pro/cpuidle-t6041

Conversation

@jgoyvaerts

Copy link
Copy Markdown
Contributor

Add "apple,t6041-cpuidle". As on T8140, iBoot locks CYC_OVRD on the M4 SoCs, so the CPU PD state cannot run and
both entries go through WFI (whose register loss the arm64 idle code already handles). Because the driver is new on
this SoC, the second entry starts CPUIDLE_FLAG_OFF: the governor and s2idle stay on WFI until it is enabled through
sysfs.

Naming: the SoC blocks use apple,t6041-*, after the T6041 (M4 Max) die the M4 Pro is cut from. Apple's device tree on an M4 Pro names the SoC arm-io,t6041, and Yureka Lilian's acked t604x bindings already use t6041 for the blocks. apple,t6040 stays the machine compatible.

Hardware tested on: Apple MacBook Pro (16-inch, M4 Pro, 2024), J616s / T6040, macOS 26.x firmware, booted by our own loader with our private T6040 device tree.

How tested: Our daily kernel boots with a root cpuidle { compatible = "apple,t6041-cpuidle"; } node: the driver binds (apple_idle), and both states show in sysfs, with the second one disabled.

Not tested / limits: Enabling the second state through sysfs, and s2idle with it, were not exercised.

Credits: The driver is the Asahi Linux contributors' cpuidle-apple; the T8140 handling reused here is from Ryan Murray and Bartosz Nitka.

Base: integration/aurora (44d5afc). Built and checked there (aurora's defconfig, W=1 on every touched object, checkpatch --strict, dt_binding_check with dtschema 2026.9). Hardware testing was done on our daily tree, which is based on aurora-wip (Linux 7.1.12) and runs this code. Merges cleanly with #366 and #367.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K4TC3f2CpzFxhnEziL9wcg

The M4 Pro (T6040) idles like T8140: the firmware locks the core
override register that requests a power-down on M1-M3, and a plain WFI
already lets the hardware power-gate the core. Add
"apple,t6041-cpuidle" for it, after the T6041 (M4 Max) die the M4 Pro
is cut from, as the other t604x block bindings do.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
The T6040 (M4 Pro) cores power down in a plain WFI: they come back with
x0-x15 and the FP/SIMD registers lost, which the arm64 idle code
already saves on this SoC. The CPU PD state requests a power-down by
setting bits in CYC_OVRD, and iBoot locks that register on the M4
SoCs, so the state cannot run here. T8140 has the same properties and
already runs both entries through WFI; do the same when the device tree
has an "apple,t6041-cpuidle" node.

The driver is new on this SoC, so mark the second entry
CPUIDLE_FLAG_OFF there: the governor and s2idle stay on the first
entry, the WFI the CPUs idle in today, until the second one is enabled
through sysfs.

The driver is the Asahi Linux contributors' cpuidle-apple; the T8140
handling reused here is from Ryan Murray and Bartosz Nitka.

Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
T6040 marked its second entry CPUIDLE_FLAG_OFF so that only the WFI
entry would run. Both entries are the same WFI here, so the flag
protects nothing, but it disables the entry for s2idle too:
find_deepest_state() skips disabled states, returns the fallback index
0, and cpuidle_enter_s2idle() does nothing. Suspend-to-idle then never
reaches tick_freeze() and timekeeping suspension, which is why T8140
keeps index 1 in the first place.

Drop the flag.

Fixes: 474e2bc ("cpuidle: apple: Add T6040 with the second state off by default")
Signed-off-by: Jonathan Goyvaerts <[email protected]>
Assisted-by: LLM
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