Commit 9fa29e88 authored by Laura Abbott's avatar Laura Abbott
Browse files

gpu: ion: Prevent deadlock with cache flushing



Cache flushing takes the mmap semaphore to validate the
address range. This can cause a deadlock in the following
scenario with two threads in the same client:

Thread 1			Thread 2
(cache operation)		(mmap)
-----------------------------------------
lock(client_lock)
				down_write(mmap_semaphore)
down_read(mmap_semaphore)
				lock(client_lock)

Fix this by doing the check for the address range before
taking the client lock. This is independent of Ion so there
is no need to have this lock locked.

Change-Id: Ibe372cf232fbad7e031ab2d38cf3a34823f43bf9
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent 6db11c95
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment