Repository navigation
T8140 camera after a DRAM-kept wake: restore the ISP DART at every power-up, as macOS does - #1393
Closed
DjDeveloperr wants to merge 2 commits into
Closed
DjDeveloperr wants to merge 2 commits into
DjDeveloperr wants to merge 2 commits into
Conversation
After a sleep that kept DRAM up, the camera failed to start until the next deep sleep: the ISP firmware booted, its first command timed out, and the ISP DART logged a fault on the firmware's read of 0x300704048, the PMGR window of the first entry of its address filter (DAPF). The ISP DART keeps Linux's values through such a wake, in which the sleep engine runs the ISP through it. They read back as before the sleep, so resume took the "state retained" path: a TLB flush, no reset, no restore, and no DAPF write, since entry 0's range still matched. After a deep wake its TTBR reads back as the engine's, so the same resume did the full reset and restore, and the camera worked. macOS's SPTM (its t8110dart powerup) restores the ISP's DARTs in full at every power-up and never tests whether the values survived: tunables, then each stream's TCR and TTBR, a TLB invalidate, every DAPF entry with its streams before its config word, the error mask, and the stream enables last. Do the same for a DART marked apple,restore-on-power-up: always take the full reset and restore at resume, and write the DAPF back even where its first range still reads back. Write each DAPF entry's stream word before its config word, as macOS does, for every DART. Mark the ISP's first DART, the one that keeps its state and holds the filter. Signed-off-by: Diljit Singh <hey@djdev.me>
…rt again The camera failed after a DRAM-kept (SLP_DDR) wake because Linux left the ISP DART's address filter as the sleep had left it; the previous commit restores the DART at every power-up as macOS does. So the sleep after an ISP start no longer has to take the deep path, and the USB host's vote for keeping DRAM up holds again whatever the camera did. Drop apple_sleep_next_deep() and its readiness flag, which had no other user. Signed-off-by: Diljit Singh <hey@djdev.me>
This was referenced Nov 10, 2026
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.
The camera failed after every DRAM-kept (SLP_DDR) wake until the next deep sleep. The ISP firmware booted, its first command (PRINT_ENABLE) timed out, and dart-isp0 logged
translation fault: SID:0 read fill region at 0x300704048. That address is the PMGR window in the first entry of the ISP DART's address filter (DAPF).Cause: the ISP DART keeps Linux's TCR and TTBR through a DRAM-kept wake, so resume took the "state retained" path: a TLB flush only, no reset, no restore, and no DAPF write, because entry 0's range still read back. The filter only works again once it is written. After a deep wake the TTBR reads back changed, so resume did the full restore and the camera worked.
macOS does this in SPTM (
sptm_t8110dart_powerup): at every power-up of the ISP DARTs it restores everything from its own copy without checking what survived: tunables, each stream's TCR and TTBR, a TLB invalidate, every DAPF entry (streams first, config word last), the error mask, the stream enables last.Two commits on #1377:
iommu: apple-dart: a DART markedapple,restore-on-power-up(dart-isp0 on T8140) always takes the full reset and restore at resume and rewrites its DAPF. Each DAPF entry's stream word is now written before its config word, as macOS does. Binding updated.media: apple: isp, soc: apple: sleep: drops t8140-sleep: take the deep path when an SLP_DDR wake would stall (camera ran, AOP crashed) #1358's rule that sent the sleep after an ISP start down the deep path, andapple_sleep_next_deep()with it. A wake that took the deep path now logsthe deep path ran.Tested on the J700 (Fedora 44 install, Fedora's kernel config plus the sleep symbols, kernel = #1374 + #1377 + this + the wake follow-ups PR, stage2-15, rig RAM boot):
test_dart_full_resume) or with the tunable words written back, and with the same fault every time.The static macOS analysis is in
camera-dart-macos/README.md(the migration notes).🤖 Generated with Claude Code