Repository navigation
soc: apple: sleep: release a bound external display's clock protection before lowering it - #2722
RyanTheTide wants to merge 1 commit into
Conversation
…n before lowering it A deep sleep of an M4 MacBook Air with an external display on its 27.2 DCPEXT hung at the commit: the engine lowers every external display's domains and released the clock-protection slice guarding its CPU power state only for an unbound one. The 27.2 DCPEXTs are now bound, stopped by the time the domains are lowered (a running one refuses the sleep), but their driver has no stop of its own that releases the slice, so the write to the CPU power state faulted. Release a still-set slice before lowering any external display, bound or not. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review at 5a229c50056f6226deb3177bd14e99e3ef9a3c06.
Zero code blockers. CI is 7/7 green, commit/DCO and clean-room rules are clean, and there are no chip/board/firmware gates (uses existing soc->disp_prot_slice[i] and s->ps_prot, reading PS_PROT_SLICE_ON before writing). sleep_display_off() (drivers/soc/apple/sleep.c:3415-3428) keeps the skip condition for unbound displays unchanged, and apple_sleep_check_displays() (drivers/soc/apple/sleep.c:3301) already guarantees no running bound display coprocessor can reach sleep_display_off().
Minor non-blocking nits
drivers/soc/apple/sleep.c:3426-3427: cachingu32 val = readl(slice);avoids reading the MMIO register twice.drivers/soc/apple/sleep.c:7088:s->ps_protis only mapped whens->soc->lower_unbound_displaysis true — fine today since only T8132 setsdisp_prot_slice, worth keeping in mind if a future SoC ever setsdisp_prot_slicewithoutlower_unbound_displays.drivers/soc/apple/sleep.c:3419-3420: oncelinux#2721lands (especially after wiring DART clock-protection release there), keep the comment aligned with whether the driver or sleep engine releases the slice.
Remaining merge gates (ready to approve once posted)
- Complete the two open "Still to run" hardware rows on the tip-based candidate: J713 deep x3 with monitor + an unbound-display Mac no-regression row, including checklist §5 regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors).
Assisted-by: LLM (Google:Gemini 4 Neon)
|
No blockers. ps_prot is only mapped for SoCs that lower unbound displays (sleep.c:7088), which today is only T8132, so other |
|
Update after #2721 moved to 8d7df23. Two points against this PR, so it is not ready to merge as it stands:
Plan: an A/B on the J713 of deep x3 with the monitor, with and without this commit, on top of #27218d7df23.
|
|
I ran the A/B planned in the review. The result is that this PR is not needed on top of #2721 at 8d7df23.
So once #2721's GAPF slices are in, a bound, stopped DCPEXT has already released its slice before Assisted-by: LLM (Claude:Opus 5.5) |
|
Superseded by #2721: the external DCP stop there releases the clock-protection slice itself, and deep sleep with a monitor passes without this change. |
Problem. On the M4 MacBook Air (J713) with an external monitor on its 27.2 DCPEXT, a deep sleep faulted at the commit. The sleep engine lowers every external display's power domains, but it only released the clock-protection slice that guards the display's CPU power state for an unbound display. The 27.2 DCPEXTs are now bound, and their driver has no stop of its own that releases the slice, so the write to the CPU power state faulted.
Change.
sleep_display_off()releases a still-set protection slice before lowering any external display, bound or not. Displays the engine skips (unbound ones on a SoC that doesn't lower them) are still skipped. The slice is only written when it is set. There is no SoC or board check; the slice comes from the SoC's existingdisp_prot_slicedata.Testing. J713, macOS 27.2 stub, stock command line, MSI monitor on DP-2, B9 kernel plus this commit:
pm_testdevices/platform/processors/core all pass. Before this commit the real deep sleep faulted inside the engine's commit with slice 5/30 still set for the bound DCPEXTs.drivers/soc/apple/sleep.ois clean.Still to run. J713 deep x3 with the monitor on the tip-based candidate that also carries #2721 (the 27.2 DCPEXT stop, which does not release the slice itself; its row passed deep 3/3 with this commit in the kernel), and one Mac whose engine lowers unbound displays (no behaviour change expected: the slice release there is the same as before).
Details for reviewers
if (i != 0 && !bound), so a bound external display reached the CPU-word write with its slice still on.!bound && !lower_unbound_displays-> continue); the release runs for every external display that is lowered, and only whenPS_PROT_SLICE_ONis set, so a display whose driver already released the slice is untouched.traces/power/20261121-j713-s2r/).Assisted-by: LLM (Claude:Opus 5.5)