Repository navigation
pmdomain: apple: keep domains the AOP raised across a sleep - #1265
Closed
DjDeveloperr wants to merge 6 commits into
Closed
DjDeveloperr wants to merge 6 commits into
DjDeveloperr wants to merge 6 commits into
Conversation
…oss a sleep On the T8140 the AOP firmware raises audio domains of its own in the always-on PMGR. Once the internal microphone array (HPAI) has run, audio_leap_rx1 is on and audio_leap_rx2-4 and audio_mca3-5_m are clock gated, while genpd, with no consumer for them, has them off. The sleep keeps them. The resume pass then put them where genpd's books say, power-gated, and the AOP never raises them again: after every sleep the array's DMA ran at 48 kHz on all-zero samples, while the low-power microphone kept working (measured). At the noirq suspend, note which domains genpd has off with a target still on. On resume, lower such a domain only if the sleep changed its target. On the J700 the array then records after the first deep sleep and after later sleeps, including a stream held open across the sleep (measured). Signed-off-by: Diljit Singh <hey@djdev.me>
Contributor
Author
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.
On the MacBook Neo (T8140, J700) the internal microphone array (HPAI) recorded silence after every system sleep. The low-power microphone kept working.
Cause. The AOP firmware raises some audio power domains itself in the always-on PMGR. genpd has no consumer for them, so it has them off. The sleep leaves them as they are, but
apple_pmgr_ps_resume_noirqpower-gated every domain genpd had off. The AOP never raises them again, and the array's DMA then ran on all-zero samples.Fix. At noirq suspend, note each domain that genpd has off but whose target is still on. On resume, lower such a domain only if the sleep changed its target. The #1255 busy-latch handling (power-on path) is unchanged.
Hardware result. J700, this branch, stock DT, four sleeps in one boot. Numbers are nonzero / distinct sample words from 1 s captures.
Without this commit, on the same #1217 head, HPAI reads 0 / 1 after the 1st and 2nd sleep, and LPAI is unaffected. After every wake, SSH, NVMe I/O, the USB devices, Wi-Fi and the panel all worked.
pm_genpd_summarywas identical after each wake and matched the run without this commit.Domains kept (listed by a log-only test build, the same on every wake):
audio_leap_rx1(on, 0xff);audio_leap_rx2-4andaudio_mca3_m-5_m(clock-gated, 0x244);dwi(clock-gated, 0x244, no consumer on J700). The first (deep) sleep also notesdpa0/1,fpwm0-2,i2c1,i2c3,msg,pmgr_soc_oclaandpms_fpwm0-4. The wake changes their target, so they are lowered as before.Also seen with and without this commit: after the first DRAM-kept wake,
phy-apple-atclogs "PHY lock request not acknowledged" andapple_soc_edacreportsni1 source 19.🤖 Generated with Claude Code