Repository navigation
media: apple: avd: Do not pop an empty mailbox - #640
Closed
AxxzyWasTaken wants to merge 1 commit into
Closed
AxxzyWasTaken wants to merge 1 commit into
AxxzyWasTaken wants to merge 1 commit into
Conversation
The interrupt handler reads MBOX1_RETRIEVE without checking that the mailbox holds a message. An interrupt that finds it empty pops the previous message again. When that is a post-processing "done", the frame is finished early, the next frame starts while the PP is still busy, its PP never completes, and the watchdog resets the decoder; the frames that follow then fail with a VP error. Seen on a J616C (T6041) with VP9 in Chromium while the system is under load: a PP "done" 8 us after its kick instead of 400-1000 us, then a timeout on the next frame. Check the mailbox's empty flag first, give a late message up to 10 us, and ignore the interrupt if the mailbox stays empty. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
Contributor
|
Reviewed for the M4 merge train. The fix is right in principle: reading Could you rebase it onto |
Contributor
Author
|
Closing: #725 added the same empty-mailbox check. |
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 AVD interrupt handler pops
MBOX1_RETRIEVEwithout checking that the mailbox holds a message. An interrupt that finds it empty pops the previous message again. When that message is a post-processing "done", the driver finishes the frame early and starts the next one while the PP is still busy. That frame's PP never completes, the 2 s watchdog resets the decoder, and the following frames fail with a VP error (H8 errorfor VP9), so the stream dies. On J616C this hit Chromium/YouTube VP9 (e.g. picture-in-picture while a game ran) every 5-15 minutes.How it was found
A per-job event trace in the driver (run, submit, every interrupt status, watchdog) caught two real faults. Both had the same shape:
H8 erroron the following frames.MBOX1_STATUS(+0x5c) reads back the mailbox state: bits 8-11 write pointer, bits 12-15 read pointer, bit 17 empty. In healthy decoding exactly one message is pending at every interrupt.The fix
Check the empty flag before popping. If it's set, give a late message up to 10 us; if the mailbox stays empty, clear the interrupt and ignore it.
Testing (J616C, M4 Max, 7.2.10)
integration/aurora(23827fe).