Skip to content

arm64: dts: apple: t8152: CPU idle driver on every M6 - #2333

Merged
RyanTheTide merged 2 commits into
integration/aurorafrom
dtfill/t8152-cpuidle
Nov 22, 2026
Merged

RyanTheTide merged 2 commits into
integration/aurorafrom
dtfill/t8152-cpuidle

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown

Problem

The Mac mini M6 (J873g) has no cpuidle node, so cpuidle-apple never binds. The CPUs idle through the default WFI without a cpuidle driver, and s2idle cannot freeze the tick or suspend timekeeping. #2107 adds the node to the J804 board file only.

Change

Add cpuidle { compatible = "apple,t8152-cpuidle", "apple,t8140-cpuidle"; } to t8152-peripherals.dtsi. Both the J873g tree and t8152.dtsi (J804, J833ct) include that file. As on T8140, the OS cannot request core power-down and WFI is the only state. The driver's T8140 profile already handles that: it does not touch CYC_OVRD on anything newer than M3.

The binding change is LiamRay11's commit from #2107, carried unchanged (same patch-id), so this can land before or after #2107. If both land, the J804 board file's own cpuidle node merges into this one.

Testing

cpp + dtc before and after: J873g, J804 and J833ct each gain only /cpuidle. dt-validate -m with this branch's bindings reports nothing new on any of them (J873g keeps its 31 existing warnings).

Still to run

  • @sithglan (J873g):
    • cat /sys/devices/system/cpu/cpuidle/current_driver shows cpuidle-apple.
    • /sys/devices/system/cpu/cpu*/cpuidle/state*/usage climbs.
    • One s2idle cycle with N1 and USB up, woken by the power key.
    • Idle power from sensors (PSTR) before and after, if the SMC exposes it.
Details
  • The driver binds by the apple,t8140-cpuidle fallback (drivers/cpuidle/cpuidle-apple.c match table). With no T8152 entry in its CYC_OVRD machine list, both of its states are WFI.
  • Evidence: traces/kernel/20261119-dtfill-m5m6/ (dts-t8152idle, valm-t8152idle-*).

Row (J873g, sithglan): cpuidle-apple binds, both states are WFI and usage climbs. The s2idle and idle-power items move to the J873g suspend bring-up: the J873g kernels build without CONFIG_SUSPEND and the board has no RTC wake yet, so they can't run there, and this change doesn't depend on them.

Assisted-by: LLM (Claude:Opus 5.5)

LiamRay11 and others added 2 commits November 19, 2026 23:52
As on T8140, the OS cannot request core power-down on T8152 (M6) and
WFI is the only idle state. Allow "apple,t8152-cpuidle" with the
T8140 compatible as its fallback, which the driver already matches.

Signed-off-by: LiamRay11 <228416644+LiamRay11@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The J873g (Mac mini, M6) has no cpuidle node, so cpuidle-apple never
binds there: the CPUs idle through the default WFI without a cpuidle
driver, and s2idle cannot freeze the tick or suspend timekeeping. The
J804 board file in #2107 adds the node for that board only.

The cores and their idle behaviour are the SoC's: as on T8140, the OS
cannot request core power-down and WFI is the only state, which the
T8140 profile of the driver already handles (CYC_OVRD is left alone on
anything newer than M3). Put the node in t8152-peripherals.dtsi, which
both the J873g tree and t8152.dtsi (J804, J833ct) include.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@sithglan

Copy link
Copy Markdown

J873g row. Kernel: #2178's head + this PR's two commits (eaf01a40812f, 35b329e1ba2c here), with CONFIG_ARM_APPLE_CPUIDLE=y. The J873g's configs had it off until now, so a board that wants this also needs the config line.

  • /sys/devices/system/cpu/cpuidle/current_driver: apple_idle (cpuidle-apple's driver name), governor menu.
  • cpu0/cpuidle/state0 and state1 are both WFI, as expected on T8140+. state1 had 1,080,308 entries since boot, and the sum over all CPUs and states rose by 3,606 in 5 s of idle.
  • s2idle cycle: not possible on the J873g today. Its kernel configs (this one and the private desktop one) build without CONFIG_SUSPEND, so there's no /sys/power/mem_sleep. The board also describes no RTC for an alarm wake. Waking with the power key also needs someone at the machine. Enabling suspend on the J873g is a bring-up of its own.
  • Idle power: macsmc-hwmon exposes 136 inputs on the J873g, all temperatures plus the fan, and no PSTR or other power key. So there's no before/after power figure from sensors.

No cpuidle warnings in dmesg.

@RyanTheTide

Copy link
Copy Markdown
Author

Thanks @sithglan. This shows the node does its job on the J873g. cpuidle-apple binds (apple_idle is its driver name), both states are WFI as expected on T8140 and later, and usage climbs on every CPU, with no warnings.

  • Good catch on the config. The node only helps where CONFIG_ARM_APPLE_CPUIDLE=y is set, so the J873g configs need that line. That's a config change, separate from this DT.
  • The s2idle item can't run until the J873g builds CONFIG_SUSPEND and has a wake source, and the SMC exposes no power key for the idle-power comparison. I'll treat both as follow-ups to the J873g suspend bring-up, not as blockers for this node.
  • J804 and J833ct pick up the same node through t8152.dtsi. A quick current_driver check on either one would also help.

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 20, 2026 03:31

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approve.

The node only selects the driver; it adds no chip list. T8152 isn't in cpuidle-apple's M1-M3 CYC_OVRD allowlist, so probe copies WFI over index 1 and both states are WFI at 1 us / 1 us. That is consistent with #2444: its 30 us / 100 us CPU PD values only reach M1-M3, and the J873g row shows both states as WFI with usage climbing. Index 1 keeps enter_s2idle, so s2idle reaches tick_freeze() the same way T8140 does. Moving the s2idle and idle-power items to the J873g suspend bring-up is fine.

Small things, none blocking:

  • The DT comment states that T8152 has no writable CYC_OVRD and power-gates idle cores after WFI. Neither is measured on T8152. I'd word it as "CYC_OVRD is written only on M1 to M3; elsewhere the driver uses WFI for both states".
  • The J873g configs need CONFIG_ARM_APPLE_CPUIDLE=y back on.
  • Once #2107 lands, the J804 board file's own cpuidle node is redundant.
  • A J804 or J833ct current_driver check after merge would be nice.

@joshuaswarren

Copy link
Copy Markdown

[Joshua's agent] Second J873g (T8152 Mac mini) test row for this PR.

Patch identity: a test-only kernel carried this PR's exact arch/arm64/boot/dts/apple/t8152-peripherals.dtsi hunk at PR head 16c25d4 — runtime DT content identical; not the full PR tree (binding-doc hunk not carried).

Kernel: 7.3.0-m6five, Image sha256 817d8162a62dee70d8c9a0c8bbe77da997d4087bc568584616f73f821a0cbf34 (build stamp Thu Nov 19 23:17:06 CST 2026).
DTB: t8152-j873g-pmgr1.dtb sha256 f4107e86f018c1a92d3a0fdabd2d77be4816d74aeca5e3395b75f5e53180278e.
Console capture: sha256 289ea8ee5801a2fc639290760c53c167e504e22b5997b96f51f49d774c985e3a (589 lines).

Observed under /sys/devices/system/cpu/cpuidle (cpu0):

  • current_driver = apple_idle
  • current_governor_ro = menu
  • state0 = "WFI CPU clock-gated"
  • state1 = "WFI CPU clock-gated"

Driver bound and both states exposed; no residency or performance measurement taken.

@RyanTheTide
RyanTheTide merged commit 24dc422 into integration/aurora Nov 22, 2026
2 checks passed
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.

5 participants