Repository navigation
arm64: idle: defer the idle=nop override until built-in drivers probe - #2190
Conversation
|
GREEN on f84ddcc Verified at exact head
|
|
GREEN on e15c2a0 Re-verdict at head
|
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
[Joshua's agent] Back to draft for now. We are re-running the pmgr kunit suite at this head: the expected write count in the give-up case ( |
|
GREEN on 86289b9 Re-verdict at head 86289b9:
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins. |
|
Thanks for the investigation and the idle-power numbers. Two points, following how we handle these in this tree: we avoid retry/sleep loops where the hardware has a status to wait on, and we select behaviour by a hardware property rather than a list of CPU parts.
The series was also measured on a different tree; a run on this head would help. We can run rows on other machines. |
|
[Joshua's agent] Replying to @RyanTheTide. Trial machine / tree: Four commits were measured on a 14-inch MacBook Pro M5 Max (J775c, T6051) on the a3m daily source 0748738 with these patches applied (patch-ids match this series). That is not the same git history as current Measured with this stack on that trial:
1) Swallowed bring-up rewrites ( 2) MIDR-gated WFI defer vs DT always-on: The deferral is tied to measured ordering (idle before Your other rows: Yes—runs on M1 Pro / M2 / M4 Pro / A18 Pro would tell us whether the pmgr rewrite is inert there and whether WFI defer or DT always-on is enough without MIDR lists. |
|
Thanks for the detailed reply and the idle-power numbers. Two follow-ups:
A run on this head is still needed; we will add rows on our lab Macs. |
|
|
Thanks.
After your boot, we'll run boot and s2idle rows on our M1 Pro, M2, M4 Pro and A18 Pro, since pmgr is shared. |
|
Dropped the The two boot reports are queued on our machines: whether "bring-up write swallowed" fires at all once WFI is deferred (T6050), and the |
The verify loop already polls with its own timeout and rewrites only on a lost-target readback, so the extra millisecond before the rewrite waited for nothing. pmgr-ppt and pmgr-bus host tests pass. Requested-by: RyanTheTide <#2190 (comment 7026530870)> Signed-off-by: Joshua Warren <[email protected]>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks for the idle-power numbers, and for correcting the KUnit claim with a real 20/20 run.
Two things hold it, and both are already in the thread:
- DCO. Every commit in a linux PR needs a Signed-off-by. 10fd7b1, a257fea, e15c2a0 and 86289b9 have none, and 10fd7b1 and a257fea are authored as
<w86@lane>with no name. Please give those two a real author (you, with a note if you like) and add sign-offs to all four. - The MIDR list in
arch/arm64/kernel/idle.c:82-85. It grows to six parts. With this series it also changes when T8142 and the first two T6050 parts start WFI, not only T6051, though the comment above it says T6050. Ryan's test is the right one: on the T6051 head boot, enable the disabledps_nub_gpio(apple,always-on) with the deferral off. If input, DP and sound come up, the fix lives in the DT and the MIDR deferral goes.
The pmgr rewrite reads fine now that b47ad13 has dropped the fixed delay. It polls ACTUAL with the timeout and rewrites only when the readback shows TARGET was lost. Ryan's question about it is answered by the same head boot: does "bring-up write swallowed" fire at all once WFI is deferred?
host-tests is green on b47ad13. Once the sign-offs are in and the boot settles point 2, the M1 Pro, M2, M4 Pro and A18 Pro boot and s2idle rows can come after the merge, with a revert ready.
The verify loop already polls with its own timeout and rewrites only on a lost-target readback, so the extra millisecond before the rewrite waited for nothing. pmgr-ppt and pmgr-bus host tests pass. Requested-by: RyanTheTide <#2190 (comment 7026530870)> Signed-off-by: Joshua Warren <[email protected]>
b47ad13 to
22cf628
Compare
|
DCO fixed on head On point 2: the T6051 head boot (enable the disabled |
|
Thanks. DCO is fixed on 22cf628. All seven commits carry a One item remains, and it is the one you list: the T6051 head boot with the disabled After that, we'll run the boot and s2idle rows on our M1 Pro, M2, M4 Pro and A18 Pro, as offered. |
|
Correction: the 14-inch M5 Max used for the earlier daily-tree trial was K114c/T6050. The verified device tree reports There is no verified T6051 system available for our run. Is there a confirmed T6051 system for the |
|
Thanks for the correction. We have no T6051 machine in our lab, so we can't run the Until then, keeping the MIDR list is fine on one condition: put the reason next to it in |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 6bb4979c88cf
Blockers:
drivers/pmdomain/apple/pmgr-pwrstate.c:186-235(1a27af5b,a6af27a9,e1519e44,73b7d67a,22cf628d): the readback-and-rewrite loop retries a domain write up to 5 times. No run shows a rewrite ever bringing a domain up: before the WFI deferral,nub_gpiostayed refused through all 5 attempts, and after it, nothing needed a retry. Fix: drop those commits and keep the deferred WFI, which is what fixed it.- The branch conflicts with
main. Then one K114c boot at the head onmain, with input, DP-1, the sound cards and idle power as before.
Checked: no Apple material; all 8 commits are signed. The MIDR list in idle.c:86-98 is documented as a hardware exception. Nit: the commits and title still say J775c/T6051; the measured Mac is K114c (T6050).
Superseded by the review at 6bb4979
On M4 and later cores the kernel ignores a loader's idle=nop and idles in WFI. On a K114c (M5 Max, chip 0x6050), switching to WFI that early let the unclaimed root domain nub_gpio gate off before pmgr and pinctrl probed: it was already off at the 76 ms pmgr probe and stayed write-refused, and the input chain, DP-1 and sound were missing. Keep the loader's spinning idle through boot and switch to WFI from a late_initcall_sync, after the built-in drivers' initcalls. cpu_do_idle() reads the idle selector on every entry, so the switch takes effect at once. Boots without idle=nop are unchanged. Signed-off-by: Joshua Warren <[email protected]> Signed-off-by: Diljit Singh <[email protected]>
6bb4979 to
77a225f
Compare
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Gemini 4 Neon on @satchlj's behalf
Verdict at 77a225f27b0a
Approve. Deferring the idle=nop -> ARM64_IDLE_WFI override from apple_wfi_quirk_init() to late_initcall_sync(apple_wfi_defer_enable) cleanly avoids early-boot WFI gating unclaimed domains before built-in pmgr/pinctrl probe while preserving apple_keep_idle_nop and post-probe WFI power savings.
Blockers
None.
Checked
- Diff audit (1 file, +22/-2):
arch/arm64/kernel/idle.c: verifiedapple_wfi_deferred(__initdata) is set only whenmidr_is_apple_m4_or_later(),idle == ARM64_IDLE_NOP, and!apple_keep_idle_nop;apple_wfi_loses_regsis still set immediately inapple_wfi_quirk_init()before the boot CPU can idle.late_initcall_sync(apple_wfi_defer_enable)flipsidle = ARM64_IDLE_WFIafter built-in driver probes complete;cpu_do_idle()readsidleon every entry.- Non-blocking nit: since secondary CPUs can already be executing
cpu_do_idle()whenlate_initcall_syncruns, pairingWRITE_ONCE(idle, ARM64_IDLE_WFI)withREAD_ONCE(idle)would satisfy KCSAN cleanly (safe in practice on arm64 for a naturally aligned 32-bit enum in an out-of-line function).
- CI at
77a225f27b0a:host-tests=SUCCESS,readiness=SUCCESS,pr-text=SUCCESS. - Posted hardware evidence: J714s (M5 Pro, T6050) boot/idle verified at identical diff; exact-head K114c (
0x6050) boot row is explicitly tracked underNot yet. - Untested scope: Static source + CI + posted-evidence review only (no kernel install/boot run by this reviewer).
Evidence
- Verified file:
arch/arm64/kernel/idle.c. - CI:
host-testsSUCCESS,readiness / readinessSUCCESS,pr-text / pr-textSUCCESS at77a225f27b0a.
|
The M5 Max (K114c, T6050) booted exact head
Boot IDs: stock |
What
Defer switching M4+ cores from a loader's
idle=nopto WFI untillate_initcall_sync, after built-in drivers (pmgr,pinctrl) have probed and claimed their always-on power domains.On a K114c (M5 Max, chip-id
0x6050), switching to WFI duringsmp_prepare_boot_cpu()allowed the unclaimednub_gpioroot domain to power-gate beforepmgrprobed at 76 ms, leavingnub_gpiowrite-refused and the input chain, DP-1, and audio absent.Stacked cleanly on merged #2796 (
midr_is_apple_m4_or_later()) with the 5 unsubstantiatedpmgr-pwrstateretry commits dropped per review.Tested
idle=nopand noarm64.nowfxtat the identical diff on top of arm64: apple: handle M4+ WFI/WFIT state loss by MIDR alone #2796 (see arm64: apple: handle M4+ WFI/WFIT state loss by MIDR alone #2796 rowissuecomment-7147410837):Apple: WFI idling deferred until built-in drivers probe-> WFI switch at0.299 sbefore/init,wfxtabsent on 18/18 CPUs,9.8 Widle power (vs10.0 Wbaseline),78,994+25,220post-deep-sleep SHA-256 runs with 0 wrong, 0 new kernel errors.scripts/checkpatch.pl --strict: 0 errors, 0 warnings.Risk
Two-way · M4 and later Macs. A plain revert restores the previous behavior. Only affects boots where the loader passes
idle=nop(andapple_keep_idle_nopis not set); boots withoutidle=nopare unchanged.Not yet
0x6050) boot row (input, DP-1, 3 sound cards, idle power, 0 failed units, 0 new kernel errors) has not yet been recorded.