Repository navigation
kernel: apple-dart: Leave a display DART that kept its state alone on resume - #169
Merged
Merged
Conversation
…resume Resume resets every DART and writes the saved TCR and TTBR values back, because a DART inside a PCIe port or another power domain that goes off in sleep loses them. The S8003 display DART is not one of those: its domain (ps_disp0) stays on, and the display pipe keeps scanning out through it for the whole sleep. The reset turns translation off and clears the TTBRs under that live scanout before the saved values are written back. Compare the live registers with the saved ones first. A DART that reads back exactly what was saved, with translation set up on at least one stream, kept its state and is left as it is. One that lost power reads its reset values and is reset and restored as before, so the PCIe DARTs are unchanged. Assisted-by: LLM
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 resume, apple-dart resets every DART and writes the saved TCR and TTBR values back. That is right for a DART inside a PCIe port or another power domain that goes off in sleep, because it loses them. The A9 display DART is not one of those:
ps_disp0) stays on.With translated scanout (#158), the reset turned translation off and cleared the TTBRs under that live scanout before the saved values went back.
The driver now compares the live registers with the saved ones first:
Other devices
This is the shared apple-dart driver. A10: enabled, untested on our side. The A10 display DART also scans out translated since #158, so the same case applies there. Any other DART that loses power in sleep behaves exactly as before.
How to test
On an iPad 5 or an A10 iPad with translated scanout on (the default since #158), as root:
The desktop must come back with a correct picture, with no DART fault and no stuck frame. Also check that NVMe and Wi-Fi still work after the wake, since those PCIe DARTs lose power and must still be restored.
Hardware
iPad 5 (J71t), cold boot, Orchard main plus this patch and our other pending iPad 5 patches: Smart Cover, Power-button, idle and RTC sleeps. After every wake, translated scanout went on with no DART fault, and NVMe and Wi-Fi came back.
Release candidate: Orchard main + #167, #168, #169, #170
Cold boot on the iPad 5 (J71t) of current main (89c9640) with exactly these four PRs merged on top, built with main's own
kernel/buildand apple-16k config, booted with a standard install's options (prepared tree 24ac68ed5ce7ae1c35f4430ea047c291e1403292, 643 patches):wake: PMU event(s) 16).wake: PMU event(s) 58, lit in 0.6 ms).wake: PMU event(s) 72on plug and on unplug. powerd lights the screen on plug and stays dark on unplug, as iOS does.suspend_stats: 6 successes and 1 failure. The failure was a Power press during suspend entry, which aborts the attempt as it should.