Repository navigation
fix(kdrv): Bound the drain after a panel read - #122
Merged
Merged
Conversation
panel_read1() bounds every wait on the DSI host but the last one: the loop that empties the read FIFO after the answer ran for as long as the FIFO did not read empty. A host whose FIFO never empties held the display task there until the task watchdog rebooted the board, the one hang the function says it does not have. An emulator without a DSI host reads the flag as 0, so every app on v0.1.0 and later rebooted before its first frame in kode-sim, at the ID probe and again at a resume of a glass left lit. The drain now stops after PANEL_READ_DRAIN_MAX words, far more than the answer to a one-byte read leaves. The byte asked for was read before it, so the read still answers: on the board nothing changes, and with no DSI host the probe passes and a resume sees a panel that is not awake and takes the full bring-up.
The drain after a DCS read is bounded so that a host that is not there cannot hold the display task. Reaching the bound still answered KODE_OK without a word: on a board that is a DSI host that does not answer, and nothing in the log said so. The read warns when it stops with the FIFO still not empty.
Contributor
|
Thanks for bringing this in. It was the one unbounded wait left in a function that promises none, and it is merged into Two things changed on the way, so you know what landed:
Checked before merging: a kodeOS build with both commits boots twice on a board, the face comes up, and the display driver logs no warning, so the drain never reaches its bound on real hardware. Size, RAM budget, layer rules and the MISRA gate are as they were. |
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.
Description of Change
panel_read1()bounds every wait on the DSI host but the last one: the loop that empties the read FIFO after the answer ran for as long as the FIFO did not read empty. A host whose FIFO never empties held the display task there until the task watchdog rebooted the board, which is the one hang the function says it does not have.PANEL_READ_DRAIN_MAX(64) words, far more than the answer to a one-byte read leaves. The byte asked for was read before it, so the read still answers.0Ahreads 0) and takes the full bring-up. Today every app built on v0.1.0 or later reboots before its first frame in kode-sim, at the probe, and kodeOS would at a resume.Test Scenarios
tools/host_tests.sh: 5490 cases across 8 suites, all passing.tools/check_layers.shclean.display_lvgldraws, kodeOS boots to its UI, an app installs and goes home by the held button and by reset with the glass kept lit, review runs - 16 of 16 display and kodeOS cases. Againstmainthe display ones fail: the task watchdog fires in thedisplaytask 6 s into the boot.Related links
Seen in kodediy/kode-sim while moving it to the newest kode-sdk.