Repository navigation
soc: apple: sleep: power the AVE complex as the encoders' parent domain - #1663
Merged
Merged
Conversation
On a T8140 with a video encoder enabled, the first wake from suspend-to-RAM resets the SoC. On the J700 that's every unit whose bootloader enables encoder 0 from the ADT. The encoders' power domains sit behind the AVE complex, the word at +0x8 in the sleep controller's cluster block. With the complex off, VENC0_SYS refuses its target. With VENC0_SYS on, the complex doesn't go off. The PMC's encoder cluster vote (VENC-CLSTR-V) behaves the same way: raised with the complex off, the complex's next power-up never completes, and with the complex off first the vote doesn't drop. .prepare turns the complex off, and the wake leaves it off. In the noirq resume genpd then raises VENC0_SYS for the encoder's DARTs, ignores the failed power-on as it does in that phase, and apple-dart restores the DARTs in an unpowered block. The kernel panics and the SoC resets. Register the complex as an IRQ-safe genpd domain, and make the enabled VENC0_SYS and VENC1_SYS domains and the PMC's encoder cluster vote its subdomains. genpd then raises the complex before any of them and lowers it after all of them: off at boot and after each wake, and on only while an encoder is in use. That's the order macOS uses; a trace of the complex word under macOS shows it raised before the encoder's power states and dropped after them. Lowering it waits for the encoder domains' BUSY bit to clear, and raising it waits out a lower still in progress. With no encoder enabled nothing changes: .prepare still turns the complex off. No device tree change is needed. Fixes: d9b438c ("arm64: apple: support coordinated suspend-to-RAM on T8140") Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 12, 2026
This was referenced Nov 12, 2026
This was referenced Nov 20, 2026
Closed
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 a T8140 with a video encoder enabled, the first wake from suspend-to-RAM resets the SoC. On the J700 that's every unit whose bootloader enables encoder 0 from the ADT (aura with #167).
The encoders' power domains sit behind the AVE complex, the word at +0x8 in the sleep controller's cluster block. With the complex off, VENC0_SYS refuses its target. With VENC0_SYS on, the complex doesn't go off, and the PMC's encoder cluster vote behaves the same way.
.prepareturns the complex off and the wake leaves it off. In the noirq resume genpd then raises VENC0_SYS for the encoder's DARTs, ignores the failed power-on, and apple-dart restores the DARTs in an unpowered block, so the kernel panics and the SoC resets. A runtime check without any sleep shows the first part: with the complex off, a runtime resume of the encoder DARTs logsPS venc0_sys: Failed to reach power state 0xf.The sleep driver now registers the complex as an IRQ-safe genpd domain and makes the enabled VENC0_SYS/VENC1_SYS domains and the PMC encoder cluster vote its subdomains. genpd raises it before them and lowers it after them. It is off at boot and after each wake, and on only while an encoder is in use. That's the order macOS uses: a macOS trace of the complex word shows it raised before the encoder's power states and dropped after them. Lowering waits for the encoder domains' BUSY bit to clear, and raising waits out a lower still in progress. With no encoder enabled nothing changes, and no device tree change is needed.
Tested on a J700 (encoder 0), production Stage 2 with a trial DTB, PMU RTC wake, kernel = integration af1bb44 + this commit:
Thanks to Diljit Singh for the macOS trace of the complex word that confirmed the order.
🤖 Generated with Claude Code