video: msm: Fix corner cases of "read twice" error
Fix several cases where histogram's completion structure is completed multiple times which causes the next histogram read to force the histogram software state machine into believing that the histogram is always being read by someone. When the timeout in mdp_do_histogram times out and then soon after the work that was being waited on completes, the next do_histogram call that is processed will not wait (and thus will not have its hist field set to NULL). This will cause all subsequent do_histograms to think that the histogram is currently being read, and will cause the "read twice" message to flood the kernel logs. This error is fixed by always initializing the completion structure before waiting for the histogram to complete. That way if the completion happens after the timeout, instead of causing the error, the completion's internal counter is reset to zero, which prevents the next histogram read from completing without waiting. Change-Id: Ic1bc4b8688cd191d226de1df15d389de09996106 Signed-off-by:Padmanabhan Komanduru <pkomandu@codeaurora.org> Signed-off-by:
Carl Vanderlip <carlv@codeaurora.org>
Loading
Please register or sign in to comment