Repository navigation
soc: apple: sleep: admit a binned part with fewer cores than the profile's machine (15-core J714s) - #3419
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 776fb440f4
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| */ | ||
| if (soc->machine && (cpu_logical_map(0) != soc->boot_mpidr || | ||
| num_possible_cpus() != soc->cpu_count)) | ||
| num_possible_cpus() > soc->cpu_count)) |
There was a problem hiding this comment.
Keep the 15-core profile gated until resume works
On the newly admitted 15-core J714s with the tested 27.2 stub, the commit's own suspend run reports that the PMP firmware never returns, the SD-reader PCIe port remains inaccessible, and CPUs 0–4 remain capped at 1.344 GHz until reboot. A successful probe reaches apple_sleep_probe()'s unconditional suspend_set_ops() and makes deep sleep the default, so an ordinary lid close now puts this machine on a known-broken resume path rather than only offering s2idle; keep this inventory rejected or opt-in until PMP/PCIe resume is fixed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. In 8cb1e48 a part with fewer cores than the profile keeps s2idle as the default and only offers deep by name (deep sleep is offered, s2idle stays the default), until the PMP resume is fixed.
| */ | ||
| if (soc->machine && (cpu_logical_map(0) != soc->boot_mpidr || | ||
| num_possible_cpus() != soc->cpu_count)) | ||
| num_possible_cpus() > soc->cpu_count)) |
There was a problem hiding this comment.
Reject kernel-clipped CPU inventories
On an 18-core T6050 booted with nr_cpus<18 or a smaller CONFIG_NR_CPUS, num_possible_cpus() is also below 18, so this condition now treats a kernel-clipped mask as a physical bin and the loop below validates only that subset. The boot loader starts all CPU nodes (t6050-base.dtsi), but spin_table_hold_parked() only coordinates for_each_present_cpu; clipped cores therefore never execute t6050_cpu_down()'s required per-core deep-sleep setup, and a core left awake can hang/reset the irreversible commit. Check the runtime DT inventory and supported per-cluster shape separately from the possible mask.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. In 8cb1e48 the inventory is the DT's CPU nodes (the cores the loader started): more than the profile's count is refused, and so is a possible mask that differs from the DT, so nr_cpus or NR_CPUS clipping is still rejected. The per-core loop is unchanged.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
776fb44 to
8cb1e48
Compare
|
Hardware row for 8cb1e48: J714s (15-core M5 Pro, 27.2 stub), 8cb1e48's change on integration 7f00dc6 (7.3.0-17.v272-24), 2026-11-27: boots, 15 CPUs, no failed units, probe passes and keeps s2idle as the default. Deep sleep itself was run at 776fb44's change (results in the description); the sleep path is unchanged in 8cb1e48. 🤖 Generated with Claude Code |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 8cb1e48f
Blockers:
pr-textCI failure (tool attribution — hard rule): commit8cb1e48fda05ends with a tool co-author trailer, and the PR description ends with a tool-generation footer line. Remove both so the commit carries only the human author and humanSigned-off-by(amend if this branch is yours alone, or recreate cleanly without force-pushing a shared branch).pr-textCI failure (Risk:line): update theRisk:line in the PR description to statetwo-wayorone-wayexplicitly (for example,Risk: two-way · J714s 15-core M5 Pro).
Checked:
drivers/soc/apple/sleep.c: code logic is clean and sound.for_each_of_cpu_node()iterates to completion without leaking device-node references, rejectsdt_cpus > soc->cpu_countornum_possible_cpus() != dt_cpus(preventing clippednr_cpussleeps and catchingdt_cpus == 0), and setss->fewer_cpusso binned parts keeps2idleas the default while offeringdeepby name. Full-core machines (dt_cpus == soc->cpu_count) are unaffected.- Hardware row: J714s 15-core M5 Pro boot row at
8cb1e48f(15 CPUs, 0 failed units,[s2idle] deep) plus 930 s deep-sleep/lid-wake row at776fb440(same sleep path); 26/26 build/KUnit CI checks green. - Checked for Apple material, private serials, and board gating: clean (uses DT CPU node count vs profile
cpu_count).
Evidence
- Head:
8cb1e48fda05(base: main,mergeable: MERGEABLE, 1 commit,+30/-4). pr-textrun46056811946failed solely on the two metadata/attribution items listed above; once cleaned up and CI is green, this is ready to merge.
|
Merge-train review at Checked:
Nit (non-blocking, same pattern as the existing Still needed: the J714s boot row at |
8cb1e48 to
530e995
Compare
|
Both pr-text items are done. The tool trailer is gone from the commit, now 530e995 with the same tree as 8cb1e48 ( Hardware row for 530e995: J714s (15-core M5 Pro, 27.2 stub), the same code on integration 7f00dc6 (7.3.0-17.v272-24), up since 2026-11-27 14:47 and checked 2026-11-28: boots, 15 CPUs, no failed units, the probe passes and s2idle stays the default. On the nit: right, |
There was a problem hiding this comment.
Verdict: MERGE at 530e995f
Blockers: none (wait for the queued CI checks at 530e995f to finish green before merge)
Checked: both prior pr-text blockers from 8cb1e48f are resolved at 530e995f (tool co-author trailer removed from the commit leaving human Signed-off-by only; PR body footer removed and Tested: + Risk: two-way added), no Apple material, no AI attribution, no chip/board gating, full diff (+30/-4 in drivers/soc/apple/sleep.c, identical tree f7ce698c to 8cb1e48f) verified — admits binned parts only when dt_cpus <= soc->cpu_count && num_possible_cpus() == dt_cpus, validates every present core's cluster/MPIDR/CPU-start bit, keeps s2idle default on binned parts (s->fewer_cpus), leaves 18-core J714s/J716c unchanged, exact-head 15-core J714s boot + probe row PASS (plus 930 s deep-sleep/lid-wake row), branch is MERGEABLE against main.
Evidence
- Verified commit
530e995f74has humanSigned-off-byonly, zero AI attribution trailers, and identicaldrivers/soc/apple/sleep.cdiff (+30/-4) to8cb1e48f. - Verified PR body has
Tested:andRisk: two-way · J714s 15-core M5 Pro ...with zero tool footers. - Exact-head J714s 15-core row (
530e995f): boots with 15 CPUs, 0 failed units, logs15 of the profile's 18 CPUs: deep sleep is offered, s2idle stays the default. - CI at
530e995f: 25 checks currentlyQUEUED(org runner backlog).
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 530e995f74
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for_each_of_cpu_node(cpu_np) | ||
| dt_cpus++; | ||
| if (cpu_logical_map(0) != soc->boot_mpidr || dt_cpus > soc->cpu_count || | ||
| num_possible_cpus() != dt_cpus) |
There was a problem hiding this comment.
Require all DT CPUs to become present
When deep is explicitly selected on the newly admitted 15-core machine and one secondary's spin-table .cpu_prepare() has failed (for example, its nonzero release address cannot be mapped), that CPU remains possible but smp_prepare_cpus() never marks it present, so this equality still passes. spin_table_hold_parked() and t6050_clusters_down_first() only walk for_each_present_cpu, omitting the loader-started core from the handoff and allowing it to remain awake at the irreversible commit; require the present mask/count to match the DT inventory too.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fair edge case. If a secondary's spin-table prepare fails, it stays possible but never becomes present, and the walks that only go over present CPUs would miss it. The fix is one more condition, num_present_cpus() != dt_cpus, which is safe at probe time since smp_prepare_cpus() has already run. On this machine all 15 are present, so it changes nothing here. It needs a rebuild and a new boot row, though, so I'd rather send it as a small follow-up than move the tested head. If you'd rather have it in this PR, I'll fold it in with a fresh row.
erikwb
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 530e995f74a4
Blockers:
drivers/soc/apple/sleep.c:2236: a secondary whose spin-table release address fails to map remains possible but never becomes present (arch/arm64/kernel/smp_spin_table.c:89andarch/arm64/kernel/smp.c:831). The new inventory check still admits the binned part. The hold and cluster power-down paths only walk present CPUs, so a core the loader started can be omitted from the irreversible deep-sleep handoff. Require all DT CPUs to be present before admitting deep sleep.drivers/soc/apple/sleep.c:8438: a 15-core J714s can now select a deep-sleep path whose reported wake leaves the SD reader inaccessible and caps CPUs 0–4 at 1.344 GHz until reboot. Keeping s2idle as the default avoids this on ordinary lid close. Keep deep sleep unavailable on the newly admitted path until the resume failures are fixed or the driver can establish that the required blocks will recover.
Checked: The 15-core J714s boot and probe row uses the same tree as this head. The deep-sleep failure was reported on the earlier build. The Apple build, KUnit, host tests and PR text passed. The branch has no conflicts.
Evidence
530e995f and 8cb1e48f have identical trees. In the boot row all 15 CPUs were present and s2idle stayed the default. The deep-sleep run at 776fb440 woke after 930 s, then logged the SD reader's failed D0 transition and the PMP timeout. The later change to the default still allows that same sleep sequence when deep is selected.
…ile's machine The J714s profile in sleep-t6050.h was measured on the 18-core M5 Pro (cpu_count = 18). The 15-core M5 Pro J714s has the same boot MPIDR (0x40000) and three clusters of five cores, and the inventory check refused it with "unsupported CPU inventory", so the driver did not probe there. Take the inventory from the DT's CPU nodes, every one of which the boot loader started: refuse more than the profile's count, and refuse a possible or present mask that differs from the DT (nr_cpus or NR_CPUS clipping, or a secondary whose spin-table prepare failed, would leave started cores out of the sleep). The loop that follows still checks every core's cluster, core number, MPIDR and CPU-start bit. On a part with fewer cores, deep sleep is off and s2idle stays the default: on the 15-core J714s a deep-sleep wake has been seen to leave the SD reader inaccessible and the PMP down, capping the CPUs until a reboot. apple_sleep.deep=1 offers it by name, as on an untested SoC. Signed-off-by: TripleU <[email protected]>
530e995 to
9c56dce
Compare
|
Both blockers are done in 9c56dce (one commit, rebased on the same base aa3351b):
Full parts are unchanged: the 18-core J714s and J716c have The hardware row for 9c56dce follows once the J714s has rebooted into it. The same diff on integration 7f00dc6 is built and installed there. |
There was a problem hiding this comment.
Verdict: HOLD at 9c56dce5 — both 530e995f code findings (present-CPU inventory check and gating deep sleep behind apple_sleep.deep=1 on binned parts) are cleanly resolved; awaiting the exact-head 15-core J714s hardware row and CI checks.
Blockers:
- Post the exact-head 15-core J714s boot and
/sys/power/mem_sleepreceipt at9c56dce5confirming all 15 CPUs present,deepabsent from/sys/power/mem_sleepby default ([s2idle]only), and clean boot/health. - Complete CI checks at
9c56dce5(fork workflow approval/run for build, KUnit, and host tests).
Checked:
- Audited
drivers/soc/apple/sleep.c(+40/-8) at9c56dce5(MERGEABLEonmain), includingapple_sleep_validate_cpu_topology(),apple_sleep_valid(),apple_sleep_ops,apple_sleep_early_ops, andapple_sleep_probe(). apple_sleep_validate_cpu_topology()now requires bothnum_possible_cpus() == dt_cpusandnum_present_cpus() == dt_cpus(alongsidecpu_logical_map(0) == soc->boot_mpidranddt_cpus <= soc->cpu_count), rejecting any CPU whose spin-table prepare failed and leaving full-core machines (dt_cpus == soc->cpu_count) unchanged.apple_sleep_valid()gatesPM_SUSPEND_MEMbehindREAD_ONCE(sleep_deep)wheneverapple_sleep->fewer_cpusis set; bothapple_sleep_opsandapple_sleep_early_opsuse.valid = apple_sleep_valid, andapple_sleep = sis published beforesuspend_set_ops(), so deep sleep is completely unavailable on binned parts unlessapple_sleep.deep=1is passed, whiles2idlestays the default even withapple_sleep.deep=1.- DCO
Signed-off-by:present on9c56dce5; no Apple material or policy issues.
Evidence
- Diff:
drivers/soc/apple/sleep.c(+40/-8). - Verified
sleep.cL7424–7446 (apple_sleep_opsandapple_sleep_early_opsboth wire.valid = apple_sleep_valid) and L8439–8453 (apple_sleep = sprecedessuspend_set_ops()). - CI at review time:
readinessqueued; build/KUnit/host-tests skipped on fork pending run.
sleep.c (apple_sleep_probe): main reworded the untested-SoC default check into one line and moved the probe diagnostics under soc->derived; this branch adds the binned-part (fewer_cpus) block just before it. The new block is kept ahead of main's version of the following lines.
|
Merged main in at |
|
Merging at |
Problem
The J714s profile in
sleep-t6050.hwas measured on the 18-core M5 Pro (cpu_count = 18). On the 15-core M5 Pro J714s the driver refuses to probe:so
/sys/power/mem_sleepoffers[s2idle]only. The 15-core part has the same boot MPIDR (0x40000) and three clusters of five cores:0x40000-0x40004,0x40100-0x40104,0x10200-0x10204.Change
cpu_countis refused, and so is a possible or present mask that differs from the DT (a kernel clipped bynr_cpusorNR_CPUS, or a secondary whose spin-table prepare failed, would leave started cores out of the sleep). The loop right after still checks every core's cluster, core number, MPIDR (cpu_valid) and CPU-start bit.apple_sleep.deep=1offers it by name, as on an untested SoC.One file.
Tested: J714s (15-core M5 Pro, 27.2 stub), deep sleep 930 s and lid wake at 776fb44's change; boot rows at 530e995 in the comments, the row for the head (9c56dce) follows there.
Risk: two-way · J714s 15-core M5 Pro (newly admitted, deep sleep off unless
apple_sleep.deep=1); 18-core J714s and J716c unchanged (same inventory, same default).Testing
J714s, 15-core M5 Pro, 27.2 stub, on integration 7f00dc6 with this change and
CONFIG_APPLE_SOC_SLEEP=y(7.3.0-17.v272-23), 2026-11-27, one machine:deep sleep is the default: boot object resumes 0;mem_sleepshowss2idle [deep].PM: suspend entry (deep),14 coprocessors up and stopped,187 of 216 AP pins changed by the sleep, all put back. Lid open after 930 s:lid open ... in sleep: wakeup,back from sleep, boot object resumes 0 -> 1,PM: suspend exit. No reset, no failed units.resume ok), the three SN201202x ports.Not back after the wake (reporting in case it is not known for T6050):
So the CPUs stay capped until a reboot. That is independent of this change (it only lets the driver probe on the 15-core part), but it is the next thing a 15-core J714s hits. Happy to run anything on this machine.