msm: mdss: fix race condition between two rotators and overlay off
Current code releases the rotator pipe only if the
active_session pointer in a session is not present,
problem is that there is a race condition where:
a rotator session 1 is in waiting state for another
rotator session 2 to finish the job; when this session 2
finishes the job, releases the active_session pointer
and signals the event to notify the other session 1,
but just before the session 1 receives the event, both
threads get preempted by a third thread (coming from
overlay off) which given the state of the SW, releases
the pipe allocated for the sessions; so next time that
session 1 is scheduled to run, it has no knowledge that
the pipe has been freed and a null pointer dereference
when trying to access the pipe happens.
To prevent this situation, add a check to make sure
there are no rotator sessions pending before releasing
the pipe.
Change-Id: I609a767d4789f13ef68c84c9e0bc69b71d6f84dd
Signed-off-by:
Ingrid Gallardo <ingridg@codeaurora.org>
Loading
Please register or sign in to comment