Repository navigation
media: apple: ave: recover a 6070 encoder after a hung frame - #1826
Merged
RyanTheTide merged 2 commits intoNov 13, 2026
Merged
Conversation
A 6070 encoder (M1 Pro, M2) whose firmware stopped answering in the middle of a session, for example a Process timeout, stayed broken until reboot. Runtime suspend refuses to gate a 6070 firmware without a scratch-confirmed Halt, so the VENC domains kept their power and every later session failed with -EIO. Once the last session has gone, runtime suspend (and system sleep) now gives the hung firmware one Halt with a short deadline. Whether or not the Halt is confirmed, the core is then stopped, CTRL must read back zero, and the engines get the usual settle interval. The firmware is then halted like any other: the buffers its sessions saw stay quarantined, genpd cycles the VENC power with the DARTs after the encoder, and the next session cold-starts the firmware and reaps that memory. If the core does not stop, the encoder stays broken as before. Recoveries count against the existing history (3 in 10 minutes); a session that ends with a confirmed Halt now clears it, so only hangs in a row without a working session in between hit the limit. System sleep keeps the boot memory mapped after such a stop instead of freeing it before the power goes. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
ave_suspend() now reads the firmware state to keep a hung 6070 firmware's boot buffers mapped after it is stopped without a confirmed Halt. Give the stub device a firmware state and check both cases: a stopped hung firmware keeps its boot buffers, a cleanly halted one releases them. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
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 6070 encoder (M1 Pro, M2), a firmware that stopped answering in the middle of a session left the encoder broken until reboot. Runtime suspend refuses to gate a 6070 firmware without a scratch-confirmed Halt, so the VENC domains kept their power and every later session failed with -EIO.
Once the last session has gone, runtime suspend and system sleep now give the hung firmware one Halt with a 500 ms deadline. The driver then stops the core, requires CTRL to read back zero and waits the usual settle interval. From there the firmware is handled like any halted one: the buffers its sessions saw stay quarantined, genpd cycles the VENC power, and the next session cold-starts the firmware and reaps that memory. If the core does not stop, the encoder stays broken as before.
Recoveries count against the existing history (3 in 10 minutes). A session that ends with a confirmed Halt now clears that history. After such a stop, system sleep keeps the boot memory mapped instead of freeing it before the power goes.
Tests
🤖 Generated with Claude Code