Skip to content

arm64: idle: T6050 idles in WFI even with idle=nop - #1152

Merged
DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
rolotrealanis98:pr/t6050-wfi-idle
Nov 10, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-silicon:integration/aurorafrom
rolotrealanis98:pr/t6050-wfi-idle

Conversation

@rolotrealanis98

Copy link
Copy Markdown
Contributor

m1n1 appends idle=nop arm64.nowfxt to the command line on M4 and later chips with locked Apple system registers, after the user's arguments, so it cannot be overridden from the command line. Aurora's m1n1 and aura already skip the append for T8140, T8132, T6040 and T6041, but not for T6050, and the m1n1 builds people use on the M5 Pro (including ours) still append it. With idle=nop both cpuidle WFI states call a cpu_do_idle() that does nothing, so the J716s (MacBook Pro 16-inch, M5 Pro) never actually idled: every idle CPU spun.

This kernel already preserves the state WFI loses on these cores (apple_wfi_quirk_init(), WFxT forced off in idreg-override), and 5c9cbb2 overrides idle=nop for T8142 for the same reason. This extends that override to the T6050 MIDRs (parts 0x064 and 0x065) and adds apple_keep_idle_nop (documented in kernel-parameters.txt) to keep idle=nop for A/B comparisons or as a fallback that needs no rebuild.

Tested on: J716s, integration/aurora + the T6050 PRs + this patch (kernel 7.3.0-gf080637018df), m1n1 still appending idle=nop arm64.nowfxt, bootargs kvm-arm.wfi_trap_policy=trap:

  • dmesg: Apple: preserving registers across WFI, Apple: idling in WFI, ignoring idle=nop; cpuidle driver apple_idle; CPU 0 spent 209 s of its first 211 s in the WFI state.
  • Idle on the charger (SMC total system power): 16.4 W with the spinning idle -> 9.8 W with this patch (heatpipe 5.7 W -> 1.9 W).
  • 56 min idle soak in one boot: no RCU stall (panic_on_rcu_stall=1), Oops or SError; a floating-point consistency run passes on all 18 CPUs; CPU 0 had 409k WFI entries.
  • s2idle on the same boot: pm_test freezer, devices and platform, then a real echo mem > /sys/power/state with power-button wake (346 s suspended, suspend_stats success 4 / fail 0, USB, Ethernet and battery back).
  • It has been the daily kernel since. On the 14-inch M5 Pro (J714s) betizzel measured 15.3 W -> 5.6 W with the same register-saving WFI.
  • arch/arm64/kernel/idle.o builds with W=1 (LLVM, arm64) on integration/aurora 4114f76; checkpatch --strict clean.

Dependencies: none; applies on integration/aurora 4114f76.

Open questions:

  • Would you rather fix this in the loader, by adding T6050 to the chip_id != ... list in m1n1/aura kboot.c that already skips idle=nop arm64.nowfxt for T8140/T8132/T6040/T6041 (T6050 still needs arm64.nowfxt unless the kernel forces it, which it does)? The kernel override would then only matter for older loaders, as it does for T8142. Happy to send that one-liner instead or as well.

m1n1 appends "idle=nop arm64.nowfxt" to the command line on every chip
whose Apple system registers are locked (M4 and later), for kernels that
do not preserve the state WFI loses there. It appends them after the
user's arguments, so an idle= on the command line cannot override it.
This kernel preserves that state (apple_wfi_quirk_init(), and WFxT is
forced off for M4 and later in idreg-override), so on T6050 idle=nop only
makes every idle CPU spin: cpuidle's two WFI states call cpu_do_idle(),
which does nothing with idle=nop.

Treat T6050 (MIDR parts 0x064 and 0x065) like T8142 and keep WFI as the
idle method. On the 16-inch M5 Pro (J716s) the system then draws 9.8 W
at idle on the charger instead of 16.4 W (SMC total system power), and a
56-minute idle soak with an FP consistency check on all 18 CPUs and four
s2idle steps up to a real suspend/resume passed. On the 14-inch M5 Pro
(J714s), betizzel measured 5.6 W against 15.3 W, and a per-CPU register
check passed 250,000 1 ms sleeps on each of its 15 CPUs.

Add apple_keep_idle_nop to keep idle=nop for comparisons and as a
fallback that needs no new kernel.

Link: betizzel/omarchy-m5@a5df9e4
Signed-off-by: Rolando Trevino <rolotrealanis@gmail.com>
Assisted-by: LLM Claude
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T14:53:04.399878Z 72f8eec PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DjDeveloperr

DjDeveloperr commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Tested on a J714s (14-inch M5 Pro), RAM-boot kit on the PR #1012 kit kernel with this commit cherry-picked, aura still appending idle=nop arm64.nowfxt: dmesg shows Apple: preserving registers across WFI and Apple: idling in WFI, ignoring idle=nop.

SMC total system power (PSTR) / heatpipe (PHPC) at idle, same machine, same kit:

  • spinning idle (idle=nop), clusters at iBoot's clocks: 20.1 / 15.6 W
  • spinning idle with cpufreq at 300 MHz: 7.2-7.9 / 4.9-5.4 W
  • this commit, no cpufreq: 3.15 / 1.7 W; with cpufreq: 2.74-2.78 / 1.36-1.42 W

Under load it also lets a single core run at its top clock: a P core measured 4.60 GHz (dependent add chain) against 3.63 GHz with its five siblings spinning, and one busy P core draws 9.5 W total with the CLPC memory floor up (7.9 W without it) instead of 44 W. Two boots (about 10 minutes of idle, loads, GPU work): no SError, Oops or RCU stall.

🤖 Generated with Claude Code

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Tested on integration/aurora itself, on a J714s (14-inch M5 Pro) booting its SSD Linux (aura still appends idle=nop arm64.nowfxt). All three kernels were built from one tree with the same config. Each set got one boot, measured with SMC total system power:

kernel idle dmesg idle power one thread on a P core (CPU 12)
d7303c3 (#1376 merge) spins T8142 message only 10.5 W 1772 MHz, 49.2 W
96b7bee spins T8142 message only 11.0 W 1425 MHz, 46.6 W
96b7bee + this PR (72f8eec) WFI Apple: idling in WFI, ignoring idle=nop 8.9 W 4311 MHz, 13.0 W
M5 default kernel (carries this commit) WFI same 7.2 W (desktop up) 4378 MHz, 13.8 W

Without this commit, integration/aurora's T6050 idle loop spins under the loader's idle=nop. Then a single busy P core sits next to five spinning siblings, and the cluster runs power-capped at about 1.4 GHz while the machine draws about 47 W. With this commit, that core reaches its top clock at the default kernel's power. No new dmesg errors or warnings come from it. The remaining idle difference, and the missing desktop, come from integration/aurora not having #1012 yet (DCP firmware-compat 27.0.0 ... is not supported; the apple,agx-g17s GPU never binds).

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