Repository navigation
media: apple: avd: park the decoder with DMA blocked; rest instead of retiring on a reset storm - #755
Closed
RyanTheTide wants to merge 2 commits into
Closed
RyanTheTide wants to merge 2 commits into
RyanTheTide wants to merge 2 commits into
Conversation
When the recovery budget runs out, or a reset fails, the decoder is retired: its jobs fail without touching the hardware until the module is reloaded. The frame that triggered it is still finished with an error, so its buffers go back to userspace while the engine that just timed out may still be running, which is the DMA-after-free pattern behind the J616s hangs. Retire through the same first steps as a recovery: disable the interrupt, stop the CM3 and attach the empty IOMMU domain, then leave it attached. A still-running engine can then only fault at the DART. A reset that fails after DMA was blocked keeps it blocked as well. Detach the empty domain at remove so a reload starts from the DMA domain. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
… storm A third recovery within a minute retired the decoder until the module was reloaded. That is too harsh for a desktop: on an M2 the H.264 conformance suite retired it within three seconds, because a few vectors use features the hardware rejects with a VP error, and every later stream failed until a reload. A user with a bad file would lose hardware decode until a reboot. Recoveries are now quiesced (DMA blocked at the DART before the reset) and have held up under forced errors, so the budget only needs to bound their rate. When it runs out, park the decoder (interrupt off, CM3 stopped, DMA blocked) and fail new frames without touching it until the budget window ends. The next frame after that resets it with DMA still blocked, restores the DMA domain and boots the firmware. Only a reset, restore or boot that fails retires the decoder. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Contributor
Author
|
Folded into one combined AVD safety-and-recovery series on branch avd/safety-recovery (same commits, on top of aurora-wip 5067ca4). Per the new one-PR-per-series rule, it opens as a single PR once the M1 Pro run and the ANE strict-flush receipt are in. |
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.
Two follow-ups to #725's recovery policy.
Why parking matters, from the #725 M2 run: after a VP9
H8 errorandrecover: stop firmware, the DART logged ten translation faults on the empty domain within 2 ms. The engine keeps doing DMA after it has reported an error.Tests
Built as an external module against 7.3.0-aurora-tt3 with W=1, no warnings. Run on the M2 (T8112) on 2026-11-01 as a module swap. Logs are in
reports/engines-20261101/avd/m2-725/.-hwaccel v4l2request): two quiesced recoveries, thendecoder resting after repeated resets, new frames fail for up to 60 s.recover: wake after rest,recover: done, then a clean decode bit-exact at H.264 1080p 503 fps and HEVC 1080p 848 fps.The M1 Pro (T6000) run follows. This PR stays draft until it passes.
🤖 Generated with Claude Code