Commit 93476a35 authored by Jeff Hugo's avatar Jeff Hugo
Browse files

msm: smd_pkt: fix wake lock locking race condition



When smd_pkt receives data for a client in userspace, smd_pkt locks a wake
lock to give the userspace client time to lock their own wake lock if
necessary.  Clients using poll() will trigger the unlocking of the wake
lock in smd_pkt, otherwise smd_pkt modifies the wake lock to expire in two
seconds.

Fix a race condition where smd_pkt locks the wake lock, the client reads
their data and triggers the unlocking, and then smd_pkt relocks the wake
lock when it modifies the timeout to two seconds.  This causes suspend to
be unnecessarily delayed.  The fix is to bypass setting the timeout if the
client has already read their data and triggered the unlocking of the wake
lock.

CRs-Fixed: 367001
Change-Id: I4e8f6975732a6139534fbeadc539e6f74ff3fce5
Signed-off-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
parent af9e5b75
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment