Draft
Conversation
The EC has a busy bit and sample ID which tells us when it's currerntly updating samples and if the data is from the current or the previous sample. Without checking this we risk reading incomplete/invalid data. So now we're implementing the logic to report data only after the EC has finished updating and we're still reading the same sample. Signed-off-by: Daniel Schaefer <dhs@frame.work>
CrosEcReadMemU8 returns 0 on IOCTL failure but we never check this. If the memmap read fails, the buffers stay uninitialized/unchanged, which makes the busy bit logic fail and the sensor report the wrong data. Add an EC_READ_U8 helper macro to checks for failure and jump to Exit with STATUS_IO_DEVICE_ERROR, so that broken EC communication is properly reported instead of producing invalid readings. Signed-off-by: Daniel Schaefer <dhs@frame.work>
812d6cf to
12ea959
Compare
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.
No description provided.