Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve CEC driver to support libCEC
cf http://stephan-rafin.net/blog/2013/09/30/i-mx6-cec/ for details
- Loading branch information
Showing
1 changed file
with
51 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
9f0faf5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you and great job sharing your efforts on this.
In hdmi_cec_write(), wait_event_interruptible() waits forever if the HDMI_IH_CEC_STAT0_DONE doesnt occur or if the interrupt itself never comes. Wouldnt it be better to put a check for the flags (O_NONBLOCK) and use wait_event_timeout() instead? Existing code could keep the caller application to hang forever.
9f0faf5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi,
You are right : some additional enhancements would be welcome as this first commit was the very least that has to be done to get a working version but is still beta.
I fully agree that O_NONBLOCK flag should be handled and that adding a timeout would be an additional guard.
Yet I don't think that we will wait forever if the HDMI_IH_CEC_STAT0_DONE does not occur : We will also be unblocked in case of error (HDMI_IH_CEC_STAT0_NACK). So unless the CEC controller goes nuts, it will raise one of these two flags and odds that we wait forever here are not so high...
But I agree with both of your remarks and will be glad to take them into account next time I dive into this piece of code