Repository navigation
cpufreq: apple-soc: park an idle cluster at its slowest state - #3717
Conversation
An idle CPU cluster keeps the performance state it was last asked for, and its voltage with it: schedutil only runs from scheduler events on the cluster's CPUs. The cpufreq driver can park a cluster whose CPUs are all idle at its slowest state and restore it when the first CPU wakes, but it needs to know when each CPU enters and leaves idle. From M4 on, the deepest idle state (index 1) is a copy of WFI. Let it call a pair of hooks the cpufreq driver installs: @Enter before the WFI, with the CPU's next timer event (cpuidle_device.next_hrtimer) and its CPU latency limit, and, if @Enter returned a cookie, @EXIT with it after the WFI. They run with RCU watching, so the state now has CPUIDLE_FLAG_RCU_IDLE and leaves RCU itself around the WFI. Neither hook may wait for the hardware. No new idle state: the table, the exit latencies and target residencies stay as they are, so the governors and the s2idle selector pick the same state as before. The state's s2idle entry is plain WFI and calls no hook. Index 0 and the M1 to M3 CPU PD state are unchanged. The cpufreq driver may be a module, and frees what a cookie points to when a policy goes away. A CPU runs @Enter, its WFI and @EXIT with interrupts off from start to end, so once it has taken an interrupt it is past @EXIT, and its next @Enter reads what was stored before the interrupt was sent. apple_cpuidle_park_sync() sends a function call to each online CPU of a mask and waits for it to run. A CPU in WFI wakes for it, so the wait is bounded, and only the CPUs of the mask are waited for: a CPU of another cluster between its own hooks does not hold it up. The cpufreq driver calls it on a cluster's CPUs before it frees the cluster, and clearing the hooks calls it on every CPU. Update the apple-dcp cpuidle-s2idle host replay for the new entry functions, and check that index 1 calls the hooks around its WFI, that index 0 and s2idle do not, that @EXIT gets the cookie of an @Enter that took part and runs only then, that the CPU has left RCU at its WFI and is back for the hooks, that interrupts stay off from @Enter to @EXIT, and that apple_cpuidle_park_sync() calls only the CPUs it is given, and waits. Based on the parking design in Ryan Murray's draft (#1988). Signed-off-by: Erik Bourget <erik@ebourget.net>
schedutil only runs from scheduler events on a cluster's CPUs, so an idle cluster keeps the last state it was asked for, and its voltage with it. A short burst of work, or a real-time task, which runs at full speed by default, leaves an idle cluster at a high state until its next wakeup. Move a cluster whose CPUs are all idle to the slowest state of its frequency table, and back to cpufreq's request when the first of them wakes. cpufreq stays the only owner of the request, and does not see a park. Parking changes neither policy->cur nor the expected state, the pending request or the verify deadline. ->get() reports the expected state of a parked cluster, the last state issued to it (a pending request or a newer limit may change what the restore writes), and reads the cluster under the lock a park takes. The expected state is cpufreq's last request, clamped to the limits and accepted by the cluster. The restore writes cpufreq's pending request if there is one, else the expected state, clamped to the limits in force then (a QoS ceiling the policy work has yet to pass on included), as an ordinary lazily verified request: the verify timer checks it, and a refusal stops requests and is reported as for any other. A cluster parks only while fast-switch requests own it, with no request pending, no failure, its last request accepted and its verify timer idle. Every request of cpufreq supersedes parking, under the same lock. A fast switch becomes the pending request, which the restore writes at once, or, while the park request runs, once it has finished; a fast switch that restores the cluster itself reports the state the restore wrote, which a limit newer than its own choice may have lowered; a new policy or thermal limit becomes the pending request, which the restore writes when a CPU wakes. Until it is written, such a request is not accepted, as for a request that finds the cluster busy: policy->cur follows it, but the time in state and the scheduler's frequency scale only once it is written, and a failure before then drops it. A waited-for request restores the cluster before its own, and stops parking until the next fast switch. Suspend and resume go through waited-for requests, so a cluster does not park from suspend until the governor runs again. Last CPU in and first CPU out are found without a new idle state. The deepest idle state calls hooks around its WFI (previous commit), and the cluster counts the CPUs idling there atomically. Only the CPU that makes the count full takes the lock to park. It marks the cluster parked and reads the count again before it writes the park request; a waking CPU lowers the count, then reads the mark; both with full barriers. So either the park is called off, or every CPU that wakes after it sees the mark, and takes the lock to restore the cluster before it runs anything. The same word counts the wakeups, and the park is called off unless it is unchanged since the last CPU counted itself in: the timers that CPU read are then those of the idle the count describes, not of an earlier one of a CPU that has woken and gone idle again meanwhile. An offline CPU is never counted, so a cluster with an offline CPU does not park, and a CPU coming online never finds its cluster parked. Each park and restore command is read back before the lock is dropped. The read completes only once the write has reached the register, so the next CPU to take the lock reads the command register after it. Latency: nothing in the idle path waits for the cluster. A waking CPU takes the cluster's lock only if the cluster is parked, and no holder of that lock waits for the cluster, so it waits at most for another CPU's short critical section. The restore is a posted write, and the waking CPU runs at the slowest state until the transition is done. A CPU that wakes while the park request is still running does not wait for it: the restore is owed to the verify timer, which writes it once the park request has finished, unless a fast switch writes first. A cluster parks only with its verify timer idle, so the timer of a parked cluster runs only for an owed restore. A CPU takes part only if its CPU latency limit allows a transition (policy->cpuinfo.transition_latency), and the cluster parks only if, as each of its CPUs went idle, none had its next timer event due within a millisecond of the park: a policy threshold against the two transitions a park costs. The next timer event is read as the generic PM domain's CPU governor does. The idle states and their numbers stay as they are, so the governors and the s2idle selector pick the same state as before, and s2idle does not park. Failures: if the cluster did not take the park request, parking stops for the cluster, and the restore is written once all the same. A park request still busy a transition timeout after it was written is a transition failure like any other: requests stop, and nothing more is written, so the cluster stays where the park request leaves it, its slowest state if it completes late, as after any timed-out transition. A waited-for request waits for the park request to finish, for at most that timeout, without holding the lock. The verify timer reports either failure, after it drops the lock; nothing prints from the idle path. There is no other correction; policy->cur changes only to drop a request the failure left unwritten. Lifetime: ->init() hands a cluster to the idle hooks through per-CPU pointers. ->exit(), which the core also calls with the cluster's CPUs online when a policy fails to come up, clears them, then waits with apple_cpuidle_park_sync() for the cluster's own online CPUs to leave the hooks (previous commit) before it frees the cluster. A CPU between them keeps the cluster its enter hook returned until then. The wait ends once those CPUs have taken an interrupt, which wakes them from WFI; CPUs of other clusters, between their own hooks, do not hold it up. The core holds the CPU hotplug lock around ->exit(), and an offline CPU is never between the hooks. Parking is on for T6050 only. It needs a SoC that verifies its requests lazily: the command register reads back the state the cluster took, so a refused park is seen, and every request goes through the lock the idle path takes. T8140 verifies lazily as well, but parking stays off there until it has been checked against T8140's thermal control on the hardware; the per-SoC flag lets it be turned on later. The other SoCs either do not read requests back, or wait for each one, which the idle path cannot. A debugfs file, apple-cpufreq/park, gives a line for each cluster that parks: its CPUs, the park and restore commands written, the failures, and whether it may park. The KUnit cases for parking work on a cluster of their own, which the idle hooks never see, and need two CPUs: run the suite with --qemu_args='-smp 2', as the kunitconfig says, or they skip. Two of them run a thread on CPU 1: a CPU waking while a waited-for request waits for a park request, and a CPU of another cluster between the hooks while a cluster is taken back. Based on the parking design in Ryan Murray's draft (#1988). Signed-off-by: Erik Bourget <erik@ebourget.net>
There was a problem hiding this comment.
Verdict: HOLD at de9aaeb9bb5a
Blockers:
- Hosted CI at
de9aaeb9bb5ais still queued (22jobs queued:apple-build,host-tests,kunit,pr-text,readiness, and KUnit suites) — wait for all checks to complete green. - M4 regression row (
J713, listed underNot yet:) confirming theCPUIDLE_FLAG_RCU_IDLE/ index-1 hook change boots and suspends/resumes cleanly on an M4 Mac wherepark_idleis off.
Checked:
- Audited
drivers/cpuidle/cpuidle-apple.candinclude/linux/soc/apple/cpuidle.h:- Verified
CPUIDLE_FLAG_RCU_IDLEhandling matchesdrivers/cpuidle/cpuidle.c: both normal idle (apple_enter_wfi_park->apple_enter_wfi_rcu) and s2idle (enter_s2idle_properskipsct_cpuidle_enter/exitwhenCPUIDLE_FLAG_RCU_IDLEis set ->apple_enter_wfi_rcu) balancect_cpuidle_enter()/ct_cpuidle_exit()cleanly without invoking park hooks in s2idle. - Verified
apple_cpuidle_set_park_ops()(smp_store_release) /apple_enter_wfi_park()(smp_load_acquire) andapple_cpuidle_park_sync()(on_each_cpu_mask) safely drain CPUs past@exitbecause interrupts remain disabled across@enter, WFI, and@exit.
- Verified
- Audited
drivers/cpufreq/apple-soc-cpufreq.c:- Verified
APPLE_PARK_LEAVE = BIT_ULL(32) - 1atomically decrements the low 32-bit idle CPU count (always>= 1onpark_wake) and increments the upper 32-bit wakeup counter without underflow. - Verified the Dekker memory ordering between
apple_soc_cpufreq_park()(WRITE_ONCE(priv->parked, true); smp_mb(); atomic64_read(&priv->park_idle) != idle) andapple_soc_cpufreq_park_wake()(atomic64_add(APPLE_PARK_LEAVE); smp_mb__after_atomic(); READ_ONCE(priv->parked)). - Verified teardown ordering in
apple_soc_cpufreq_exit()(drain()setswaited = true, unparks, and cancelsverify_timerbeforepark_withdraw()clearsapple_park_priv, runsapple_cpuidle_park_sync(&priv->park_cpus), and freespark_next) andmodule_exit()(park_unregister()beforecpufreq_unregister_driver()). - Noted
J716c(M5 Max, T6050) exact-headde9aaeb9boot + 30 s deep sleep + battery idle power proof,108/108KUnit (17parking tests), and35/35apple-dcplifecycle replay.
- Verified
Evidence
- Head:
de9aaeb9bb5a9182cd413d08acf7f0f8916b174b(basemain,MERGEABLE, 2 commits:fd61387242,de9aaeb9bb). - No code, concurrency, or RCU defects found; T8140 parking enablement is out of scope for this PR and not a blocker.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: MERGE at de9aaeb9bb5a
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: - Audited drivers/cpuidle/cpuidle-apple.c and include/linux/soc/apple/cpuidle.h:
- Verified
CPUIDLE_FLAG_RCU_IDLEhandling matchesdrivers/cpuidle/cpuidle.c: both normal idle (apple_enter_wfi_park->apple_enter_wfi_rcu) and s2idle (enter_s2idle_properskipsct_cpuidle_enter/exitwhenCPUIDLE_FLAG_RCU_IDLEis set ->apple_enter_wfi_rcu) balancect_cpuidle_enter()/ct_cpuidle_exit()cleanly without invoking park hooks in s2idle. - Verified
apple_cpuidle_set_park_ops()(smp_store_release) /apple_enter_wfi_park()(smp_load_acquire) andapple_cpuidle_park_sync()(on_each_cpu_mask) safely drain CPUs past@exitbecause interrupts remain disabled across@enter, WFI, and@exit. - Audited
drivers/cpufreq/apple-soc-cpufreq.c:- Verified
APPLE_PARK_LEAVE = BIT_ULL(32) - 1atomically decrements the low 32-bit idle CPU count (always>= 1onpark_wake) and increments the upper 32-bit wakeup counter without underflow. - Verified the Dekker memory ordering between
apple_soc_cpufreq_park()(WRITE_ONCE(priv->parked, true); smp_mb(); atomic64_read(&priv->park_idle) != idle) andapple_soc_cpufreq_park_wake()(atomic64_add(APPLE_PARK_LEAVE); smp_mb__after_atomic(); READ_ONCE(priv->parked)). - Verified teardown ordering in
apple_soc_cpufreq_exit()(drain()setswaited = true, unparks, and cancelsverify_timerbeforepark_withdraw()clearsapple_park_priv, runsapple_cpuidle_park_sync(&priv->park_cpus), and frees
- Verified
Follow-ups (not blocking): queued CI; J713 M4 regression row
Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Forward-merged Changes in
Verification at
Hardware scope:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed the fully ordered park/wake count, timer handoff on a busy restore, and hook withdrawal before freeing per-CPU state. The exact-head J716c and J713 rows cover parking and the shared idle hooks. Hosted Apple build and KUnit are still pending.
|
Tested Results on J616C:
Happy to send the one-commit |
Use verify_transition for the parking path and its invariant test now that fast-switch verification no longer has a separate flag. Use the policy's transition latency for park restore and reset retry backoff for each issued request. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Forward-merged current main at The conflict touched runtime code, so the earlier rows are baseline evidence. The next hardware rows are J714s/T6050 for a clean boot, counters advancing with zero park failures, and parking resuming after deep sleep, plus J773g/T8132 for normal frequency switching with parking inactive. Please tie results and re-review to |
|
J714s / T6050 hardware result at |
|
J714s / T6050 hardware result at
The J714s/T6050 row at |
Idle cluster parking requires command-state readback and lazy verification under priv->lock so refused parks are detected and every DVFS request serialises with the idle hooks. Now that main uses verify_transition across all SoCs with that hardware capability (T6050, T8140, T8142, and T8152), drop the T6050-only park_idle table flag and enable idle parking wherever verify_transition is set. Update apple_soc_cpufreq_get_rate() to take priv->lock for all verify_transition SoCs, and update the KUnit invariants and parking tests to cover T8140 and T8142 alongside T6050. Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Addressed the review findings in
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Approving at 99fc90dbe301.
Earlier findings
- The T6050-only
park_idleflag is gone. Parking is now picked from theverify_transitioncapability in match data (drivers/cpufreq/apple-soc-cpufreq.c:2429), with no SoC or board check. Fixed. ->get()now reads a parked cluster underpriv->lockon everyverify_transitionSoC (:519). Fixed.- The PR text now calls J714s an M5 Pro. Fixed.
The lock in ->get()
priv->lock is a raw spinlock, always taken with irqsave. The core calls ->get() only from process context: sysfs cpuinfo_cur_freq, cpufreq_online(), governor start, cpufreq_get() and the policy refresh. cpufreq_quick_get() never calls it, because this driver has no ->setpolicy. Nothing that holds priv->lock calls back into the core, and the locked section only reads the command register. So there is no sleeping in atomic context and no self-deadlock. On T6050 this commit changes nothing at run time, since park_idle was already set there, so the J714s deep-sleep row at d072461a still covers T6050.
Wider enablement
T8140, T8142 and T8152 read back the accepted state in PS1, like T6050. The park state comes from the OPP table, which init already checks against min_pstate, so state IDs that start at 1 or 2 are fine. A fast die-temperature cap that arrives while a cluster is parked becomes the pending request, as on J714s. Two things differ from T6050:
- T8140 sets no
transition_timeout_us, so a park that is still busy after 400 us (instead of 2000 us) counts as a failure, and requests on that cluster stop until a firmware resume. - The hooks never run on T8152 (
t8152-j873g.dtshas no cpuidle node, andcpuidle-apple.cdoes not list T8152 for its fallback device). They also never run on T8142 boots that idle through cpuidle-psci (t8142-j813-psci-idle.dtsi). Parking does nothing there, but theparkdebugfs file still lists those clusters asenabled 1with no parks.
Not blocking
drivers/cpufreq/apple-soc-cpufreq-test.c:2525:cft_test_get_parked()turns onfast_switch_enabledon the live policy while schedutil is still running. The comment at:2640warns against exactly that race. Drop the flip (the parked read does not depend on it), or usecft_live_policy_setup().- PR text: say that parking is live on T6050, T8140 and non-PSCI T8142, and does nothing on T8152 and PSCI T8142, so rows there aren't read as parking passes.
- No hosted CI has run at this head yet.
Still owed before merge (already in Not yet): a J700 (T8140) row with parking on. That is where parking is new in our fleet. It should show enabled 1 and failed 0 on both clusters with the counters rising, a normal ramp under load and back down, none of the lines "busy timeout", "stopping requests" or "did not park", and a GPU benchmark with no drop against main. Also a T8132 control row at this head.
|
Local CI passed for head
The J700 parking and J773g control receipts at |
J773g (M4 mini, T8132, OS FW 27.2 / 26B123) — PASS (T8132 control row)Tested exact PR head
|
J700 (MacBook Neo, T8140): PASS, head vs base, with idle parking onThis is the first board where the PR turns parking on. I ran two one-shot boots on the same J700 on the same day, with the same
Results (both arms exit 0)
GPU A/B: head/base is 1.0227, inside the kit's 1.03 bar. The gap is consistent rather than noise: each arm's three run medians sit within 0.4 % of each other. Depth 1 idles the CPU between submits, so this looks like the wake-up cost of parking: about 3 µs per submit on T8140. Between days and kernels, this case's medians have moved by more than that (126.5–135.0 µs). Things worth knowing
Stock restored after each arm: the return boot ran the configured Stage 2 and stock |
|
PASS J714s (M5 Pro, T6050) linux#3717 head 99fc90d in composite b6002784 (main c2f1583 + #3410 465d7cf + #3334 7be3a9c + #3717 99fc90d + #3970 9b4f688, 7.3.0-m5-comp-3410-3970): apple-cpufreq/park enabled=1 failed=0 all 3 clusters (0-5, 6-11, 12-17), pre-sleep burst parks +316/restores +313, 2x rtcwake -m mem -s 20 clean resumes (20.75s/20.41s, suspend_success 0->2, suspend_fail 0, post-sleep parks 11148 failed=0), 0 Oops/WARN/BUG/GPU/DART faults, WDT armed, clean stock handback (b2c723cd). |
What: When every CPU of a cluster is idle, park the cluster at its slowest performance state, and restore cpufreq's request when the first CPU wakes. cpufreq stays the only owner of the requested speed. The idle table and s2idle are unchanged. Selected by hardware capability (
verify_transition: command-state readback and lazy verification), enabling it acrossT6050,T8140,T8142, andT8152. Based on the design in #1988 by @RyanTheTide; this rewrites it for main's lazily verifying cpufreq (reconciled ontoverify_transition,transition_ns,retry_ns, andfast_switch_possible = trueind072461ac9f9, then dropping the T6050-onlypark_idletable gate in99fc90dbe301), with KUnit coverage, and replaces that draft.Tested: Exact head
99fc90dbe301:J716c(T6050, firmware27.2, desktop up,0Oops/WARN/BUG/Call trace) in a composite trial kernel (origin/maind3de772ac0c1+99fc90dbe301,#3398/#3410,#3409,#3273,#3289,#3359) passed cluster parking (/sys/kernel/debug/apple-cpufreq/park:enabled 1,failed 0across all three clusters before/after a 6 s three-cluster load) and DVFS ramp under pinned load (300 / 4044 MHz->4380 / 4380 / 4608 MHzwithin0.5 s->2964 / 300 / 300 MHz3 safter); dedicated cpufreq KUnit suite (drivers/cpufreq/apple-soc-cpufreq.kunitconfig, arm64 QEMU-smp 2, LLVM):113/113passed (apple_soc_cpufreq56subtests including all17parking cases plusT8140/T8142park/restore,apple_soc_cpufreq_policy10subtests includingT8142get_ratewhile parked),arm64LLVM=1W=1aurora_defconfigbuild ofdrivers/cpufreq/apple-soc-cpufreq.oanddrivers/cpuidle/cpuidle-apple.o(0warnings),checkpatch.pl --strict(99fc90dbe301andde9aaeb9bb5a0errors /0warnings), and cleangit merge-treeagainstorigin/main. Prior-head baseline checks (J714sM5 ProT6050atd072461ac9f9with physical deep sleep and post-wake Borealis RT;J716cat27ffbe1aa92aandde9aaeb9bb5a, including16.61 Wvs16.75 Wbattery idle power;J713at27ffbe1aa92aandde9aaeb9bb5a;J616Cby @AxxzyWasTaken with localsoc_t6041_infoat27ffbe1aa92a;cpuidle-s2idle168assertions at27ffbe1aa92a) are recorded under Evidence as pre-99fc90dbe301baseline evidence (drivers/cpuidle/cpuidle-apple.candinclude/linux/soc/apple/cpuidle.hare unchanged sincede9aaeb9bb5a).Risk: two-way door · parking:
verify_transitionSoCs (T6050,T8140,T8142,T8152) · the idle-state change (hooks, RCU-idle flag on index 1): every M4-and-later MacNot yet: Exact-head
99fc90dbe301T6050(J716c) sleep/wake verification (rtcwake -d /dev/rtc1 -m freeze -s 10s2idledid not wake without a local key press, matchingmain; realdeepsuspend/resume not yet run;J714snot re-tested at99fc90dbe301); exact-head99fc90dbe301T8132(J713) control pass demonstrating frequency transitions under load with parking inactive pluss2idleanddeepsleep (J713currently off-network/unreachable);T8142/T8140/T8152hardware rows with parking active; hosted CI and independent approving review at99fc90dbe301.Details
Two feature commits (
fd6138724211,de9aaeb9bb5a), two forward merges (27ffbe1aa92a,d072461ac9f9), and capability-based selection (99fc90dbe301):@enter/@exithooks that the cpufreq driver installs, around its WFI.@entergets the CPU's next timer event and its CPU latency limit. The state gainsCPUIDLE_FLAG_RCU_IDLEand does its ownct_cpuidle_enter/exit. Exit latencies and residencies are unchanged, so the governors and the s2idle selector pick the same state as before; the s2idle entry is plain WFI and calls no hook.apple_cpuidle_park_sync(mask)waits for the CPUs of a mask to be past their hooks (an IPI wakes them from WFI), so a cluster can be freed safely, and CPUs of other clusters don't hold that up.APPLE_PARK_MIN_IDLE_NS, a named policy constant), each CPU's latency limit allows a transition, and the cluster is idle as far as cpufreq goes: fast switch in charge, nothing pending, its last request accepted, its verify timer idle.policy->cur, not the expected or pending state, not the verify state.->get()of a parked cluster reports the last state issued to it.apple-cpufreq/park: per cluster, parks, restores, failures, enabled.d072461ac9f9(main5de2a38b404d): adoptsmain's unifiedverify_transitionflag (replacinglazy_verify), uses per-policypriv->transition_nsinapple_soc_cpufreq_unpark(), preservespriv->retry_nsbackoff reset acrossapple_soc_cpufreq_lazy_issue(), and keepspolicy->fast_switch_possible = true.verify_transition,99fc90dbe301): parking needs a SoC whose command register reads back the state the cluster took (verify_transition), so a refused park is detected and every request serialises underpriv->lock. Removing the T6050-onlypark_idleflag enables parking across allverify_transitionSoCs (T6050,T8140,T8142, andT8152) and takespriv->lockin->get()across all of them. On boards withapple,fast-die-effort(T8140,T6050J714s), fast die-temperature cap updates while parked queue intopriv->pending_pstateand apply on restore; onT8142under/psci,cpuidle-pscihandles idle socpuidle-applehooks are unused, while non-PSCIcpuidle-appleboots park throughapple_enter_wfi_park. Non-verify_transitionSoCs (T8132,T8112,T8103,S5L8960X) keep parking disabled.Evidence
Exact-head checks at
99fc90dbe301origin/maind3de772ac0c1+99fc90dbe301and#3398/#3410,#3409,#3273,#3289,#3359, chained dead-man trial Stage 2, desktop up,0Oops/WARN/BUG/Call trace):/sys/kernel/debug/apple-cpufreq/park:enabled 1on all three clusters,failed 0throughout (cpus 0-5:2228/2220 -> 2251/2243,cpus 6-11:1334/1325 -> 1350/1342,cpus 12-17:1041/915 -> 1067/941parks/restores before and after a 6 s three-cluster load).cpu0,cpu6,cpu12):300 MHz / 4044 MHzidle ->4380 / 4380 / 4608 MHzwithin0.5 s, settling back to2964 / 300 / 300 MHz3 safter.99fc90dbe301:rtcwake -d /dev/rtc1 -m freeze -s 10(s2idle) did not wake without a local key press (matchingmain), and realdeepsuspend/resume was not run../tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/cpufreq/apple-soc-cpufreq.kunitconfig --qemu_args="-smp 2"):113/113passed (0failed,0skipped;apple_soc_cpufreq:56subtests including all17parking cases andT8140/T8142park/restore incft_test_park_restore;apple_soc_cpufreq_policy:10subtests includingT6050/T8142cft_test_get_parked;apple-clpc-gpu:15;apple-clpc-policy:6).arm64LLVM=1W=1aurora_defconfigbuild ofdrivers/cpufreq/apple-soc-cpufreq.oanddrivers/cpuidle/cpuidle-apple.o:0warnings.scripts/checkpatch.pl --strict --git origin/main..99fc90dbe301:de9aaeb9bb5aand99fc90dbe301clean (0errors,0warnings,0checks);fd6138724211has oneMAINTAINERSwarning forinclude/linux/soc/apple/cpuidle.h, already covered byF: include/linux/soc/apple/*.git merge-tree --write-tree origin/main 99fc90dbe301: clean (bf0b7dd3c581).Prior-head baseline evidence (
d072461ac9f9,27ffbe1aa92a, andde9aaeb9bb5a, before99fc90dbe301)d072461ac9f9:apple-build,host-tests,pr-text,readiness,KUnit plan,KUnit dcp-topology asahi— allSUCCESS.drivers/cpuidle/cpuidle-apple.candinclude/linux/soc/apple/cpuidle.hare unchanged sincede9aaeb9bb5a.d072461ac9f9(7.3.0-m5-pr3717-d072461ac9f9):16SLC planes,online=1, SEP writes enabled,0GPU/MMU faults or panics).30.36 svia/dev/rtc1apple-pmu-rtc):suspend_statssuccess0 -> 1,fail0;apple-sleepfirmware resume0 -> 1./sys/kernel/debug/apple-cpufreq/park: all three clusters stayedenabled 1withfailed 0, and all three 300 MHz minima were restored (cpus 0-5:2,402 / 2,402 -> 2,425 / 2,425;cpus 6-11:35 / 35 -> 1,658 / 1,640;cpus 12-17:29 / 28 -> 2,217 / 2,215).rt.scenemedium, 3 runs, timestamps on, Borealisgit-d725cb9a39) passed all 3 runs with CRC32b541b83eand403.9 FPSmedian (431.2 FPSGPU-timed median),0GPU/MMU faults or panics in retained journal, clean stock handback.J716c (M5 Max, T6050) at
de9aaeb9bb5a/27ffbe1aa92a(default command line):WFI WFI), no oopses or WARNINGs. One failed unit,aurora-peripherals.service, which fails the same way on the daily without this change.apple-cpufreq/parkabout a minute after boot:cpus 0-5 parks 2708 restores 2695 failed 0 enabled 1,cpus 6-11 parks 1430 restores 1421 failed 0 enabled 1,cpus 12-17 parks 1712 restores 1536 failed 0 enabled 1.rtcwake -d rtc1 -m mem -s 30): woke on the RTC, desktop and Wi-Fi back, parking running again on all three clusters, 0 failures.27ffbe1aa92amerged withmain429e7e15f122(one-shot trial kernel with five other open PR heads, Linux7.3.0, AC, default command line, default Stage 2): idle tableWFI WFI,apple-cpufreq/parkenabled 1on all three clusters (cpus 0-5 parks 14840 restores 14803 failed 0,cpus 6-11 parks 4591 restores 4529 failed 0,cpus 12-17 parks 5249 restores 5064 failed 0, counters rising 10 s apart at idle), checked after 2xpm_test=devicesand 1xpm_test=platformsuspend cycles, 4xeDP-1DPMS off/on,vkcube --c 240 --wsi waylandclean,0GPU/MMU faults or Oops/WARN,1failed unit (aurora-peripherals.service, as on default).Idle power on battery (J716c,
de9aaeb9bb5a). Idle desktop, panel on at the same brightness, 3 min settle then 15 min measured. Drain from the battery coulomb counter (charge_counter) times the mean battery voltage. CPUs 0.13 to 0.14% busy in both runs.de9aaeb9)An earlier prototype measured 16.65 W vs 16.76 W the same way. Both pairs ran the parking kernel first.
J616C (M4 Max, macOS 27.2
26B123) at27ffbe1aa92a(reported by@AxxzyWasTakenwith a localsoc_t6041_infoentry): all three clusters (cpus 0,5-8,1-4,9-13) actively parked and restored withfailed 0,enabled 1across cold boot idle (parks 100/223/71,restores 88/221/63) ands2idle+ 2x deep sleep (parks 154/13/8,restores 138/13/7),0cpufreq/cpuidle warnings or regressions indmesg.J713 (M4 Air, T8132), the idle-state change without parking (
de9aaeb9bb5a):de9aaeb9)WFI WFI), noapple-cpufreq/park(parking off)J713 (M4 Air, T8132, 27.2 firmware) at
27ffbe1aa92ain the composite trial kernel (main429e7e15f122with#3359,#3560,#3491,#3717,#3297,#3300; Linux7.3.0, battery, default command line, GRUB one-shot + one-shot Stage 2 carrying compositet8132-j713.dtb): parking stays off on T8132 (no/sys/kernel/debug/apple-cpufreq/park,apple_soc_cpufreqloaded,apple_idle, P-cluster idle at 912 MHz),s2idle(20 s) and deep suspend/resume (25 s) resumed cleanly (suspend_statsfail0,0failed units,0AppArmor denials,0Oops/WARN).Prior host tests at
27ffbe1aa92a:cpuidle-s2idlehost replay (tools/testing/selftests/drivers/gpu/apple-dcp/idle.py): 168 assertions passed at27ffbe1a(-Wno-unused-but-set-globalunder host clang 23 for the existingsystem_statestub; 35/35apple-dcplifecycle replay passed atde9aaeb9).arm64LLVM=1W=1builds ofdrivers/cpufreq/anddrivers/cpuidle/at27ffbe1a:0warnings.