Repository navigation
pmdomain: apple-pmc: restore display interface enables after deep sleep - #3452
Merged
RyanTheTide merged 1 commit intoNov 30, 2026
Merged
Conversation
Deep sleep on T8132 clears the PMC display BWR interface enable word (0x2020) and resets the boost interface enable word (0x2028) to BIT(0) (internal display only), while genpd continues to track powered external display interface domains (pmc-dispext0-interface, pmc-dispext1-interface) as on. Because apple_pmc_resume_early() previously restored only rail enables, floors, and the AP DCS vote, external display pipes remained stuck at their lowest display clock after resume, causing scanout underrun on high-pixel-rate modes such as 5120x2160@165 Hz. Track powered state in dom->on for genpd interface domains (initialized from the boot register state and updated on successful power_on/power_off), extract lock-held apple_pmc_interface_apply(), and restore powered non-consumer-switched interface domains in apple_pmc_resume_early() via apple_pmc_interfaces_restore(). Consumer-switched interfaces remain managed by their consumer. Add KUnit coverage in pmc-test.c verifying that powered genpd interface domains (both runtime-enabled and boot-inherited) are restored after simulated register loss while off and consumer-switched domains are left alone. Signed-off-by: Joe Stango <[email protected]>
satchlj
approved these changes
Nov 28, 2026
satchlj
left a comment
Member
There was a problem hiding this comment.
Reviewed at exact HEAD ecfd0f1138d0:
- Code review: tracking
dom->onfor@interfacedomains underpmc->lock(initialized from boot-saved BWR/boost state inapple_pmc_interface_init()and updated only on successfulapple_pmc_interface_apply()) and restoring powered non-consumer-switched domains inapple_pmc_resume_early()is clean and lock-safe, with a clean no-op whenbwr_enable/boost_enableare absent and solid KUnit coverage inapple_pmc_test_interface_resume. scripts/checkpatch.pl --strict --no-tree: 0 errors, 0 warnings, 0 checks.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Member
|
Hardware row at exact head
(Looks like only adding the |
satchlj
added a commit
to satchlj/linux
that referenced
this pull request
Nov 28, 2026
Keep .untested = true and .display_no_restart = true on t8122_sleep_soc so /sys/power/mem_sleep remains [s2idle] by default until all T8122 deep-sleep prerequisites (aurora-silicon#3425, aurora-silicon#3504, aurora-silicon#3445, aurora-silicon#3452) have landed and 27.2-firmware T8122 boards (J615) have a matching display sleep path. With .untested and .display_no_restart preserved, default s2idle and apple_sleep.deep=1 dry runs stay intact on both 26.6.2 (J613) and 27.2 (J615), while committed J613 deep sleep runs via apple_sleep.deep=1 apple_sleep.untested_commit=1. Signed-off-by: Satya Benson <[email protected]>
Contributor
|
Merged, thank you @stango-git. Your J713 run plus satchlj's J613 deep-sleep row at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tested: J713 M4 Air (T8132) at ecfd0f1: BWR/boost enables restored across deep sleep, clean 165 Hz external output; J613 M3 Air (T8122) at ecfd0f1: 3/3 mem/deep cycles, 0 failed units.
Risk: two-way · M4 (T8132); a plain revert undoes it, no-op on other SoCs.
What: Restore powered non-
consumer_switchedPMC display BWR (0x2020) and boost (0x2028) interface enable bits inapple_pmc_resume_early()after firmware deep sleep so external display pipes do not stay stuck at minimum display clocks on resume.Tested:
ecfd0f11on J713 (M4 MacBook Air 13", T8132,Mac16,12) + Dell AW3926QW (5120x2160@165 Hz over USB-C DP Alt Mode): PASS —bwr enable: 0x00000018andboost enable: 0x00000007restored cleanly across deep sleep + wake cycles with 0apple-pmcerrors and clean full-screen 165 Hz output (tested on7.3.0-dualpipe-s2+, byte-identical PMC diff toecfd0f11).ecfd0f11on J613 (MacBook Air 13" M3, T8122, macOS 26.6.2 / 25G83 firmware, tested bysatchlj): PASS — 3/3 consecutive realmem/deepsuspend/resume cycles (boot object resumes 0 -> 1 -> 2 -> 3), clean internal DCP warm-restart,systemctl --failed == 0.drivers/pmdomain/apple/pmc.obuilt withLLVM=1 W=1both with and withoutCONFIG_APPLE_PMC_KUNIT_TEST=y(0 new warnings);scripts/checkpatch.pl --strict --no-tree0 errors / 0 warnings.Risk: two-way door · M4 (T8132) — cleanly revertible kernel-only change with no bootloader, DT, or persistent state changes;
bwr_enable/boost_enableare only populated onapple_pmc_hw_t8132(clean no-op elsewhere), andconsumer_switchedinterfaces (internaldisp0) remain managed by their consumer.Not yet: Non-J713 T8132 Macs with high-pixel-rate external displays; running
apple_pmc_test_interface_resumeKUnit live in-kernel (compile-verified withLLVM=1 W=1).Details
Deep sleep on T8132 clears the PMC display BWR interface enable register (
0x2020) to0x0and resets the boost interface enable register (0x2028) toBIT(0)(internal display only), whilegenpdcontinues to track powered external display interface domains (pmc-dispext0-interface,pmc-dispext1-interface) ason. Becauseapple_pmc_resume_early()previously restored onlyrail_enable, rail floors, and the AP DCS vote, external display pipes remained stuck at their lowest display clock after deep sleep — causing immediate scanout underrun on high-pixel-rate modes (e.g. 5120x2160@165 Hz).dom->onfor genpd display interface domains (apple_pmc_interface_init()from boot register state, updated inapple_pmc_interface_set()underpmc->lock).apple_pmc_interface_apply()and callapple_pmc_interfaces_restore()fromapple_pmc_resume_early()to restore powered non-consumer_switchedinterface domains' BWR and boost enable bits after firmware sleep.consumer_switchedinterfaces (internaldisp0) untouched, as their consumer manages their bits.apple_pmc_test_interface_resumeKUnit test indrivers/pmdomain/apple/pmc-test.c.Evidence
Mac16,12, J713, 5120x2160@165 Hz external display over USB-C DP Alt Mode):/sys/kernel/debug/apple-pmc/382800000.power-management/statusdropped frombwr enable: 0x00000018,boost enable: 0x00000007before sleep to0x00000000/0x00000001after deep sleep, causing scanout underrun below the top ~40 lines at 165 Hz.bwr enable: 0x00000018,boost enable: 0x00000007are restored cleanly across deep sleep + wake cycles with zeroapple-pmcerrors and clean full-screen 165 Hz output.satchlj): J613 (MacBook Air 13" M3, T8122) at exact headecfd0f11— 3/3mem/deepsuspend/resume cycles passed,systemctl --failed == 0.LLVM=1 W=1build ofdrivers/pmdomain/apple/pmc.owith and withoutCONFIG_APPLE_PMC_KUNIT_TEST=y(0 new warnings);scripts/checkpatch.pl --strict --no-tree(0 errors, 0 warnings, 0 checks).