Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f893e74b authored by Shubhraprakash Das's avatar Shubhraprakash Das Committed by Stephen Boyd
Browse files

msm: kgsl: Check whether context is detached before updating timestamp



When context is detached there is a wait for the last timestamp
used by the context. This is done under the assumption that after
this timestamp there will be no commands in the pipeline that are
submitted on behalf of this context. However, the dispatcher can
still dispatch commands from the detached context because there
is a time gap between the context being detached and the dispatcher
checking whether the context is detached. Hence, guard the last
timestamp by holding the context mutex and checking if the context is
detached or not before updating it.

Trying to guard internal_timestamp with drawctxt->mutex could lead
to a locking order inversion and possibly deadlock. This variable
is set in adreno_ringbuffer_addcmds(), and used in kgsl_context_detach().
Both of these calls hold device->mutex, so it is safe to access
this variable without an additional mutex.

Change-Id: Idc1a867de94e071a3128a164724d26dd9cb29a0a
Signed-off-by: default avatarShubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: default avatarJeremy Gebben <jgebben@codeaurora.org>
parent 0771c7c5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment