Commit 54827edc authored by Dixon Peterson's avatar Dixon Peterson Committed by Gerrit - the friendly Code Review server
Browse files

diag: fix hsic concurrency issue when in MEMORY_DEVICE_MODE



When the logging mode changes to MEMORY_DEVICE_MODE, an array
is used to house the pointers to the data read from the hsic
until the data can be copied to user space. Since the storing
and copying actions access this array in different threads,
access to this array can result in concurrent access by these
threads. Note that the storing access to the array happens in
interrupt context and the copying access happens in process
context.  Use spin_locks to protect agains this concurrency
issue.

Also, there is unnecessary queuing of the hsic read work function
on the work queue. Add checks to remove this unnecessary queuing.

Signed-off-by: default avatarDixon Peterson <dixonp@codeaurora.org>

Change-Id: I8f45d1e88317e2da1f9498cce8b5e8666e58dd2e
Signed-off-by: default avatarNeha Pandey <nehap@codeaurora.org>
parent 3a3ab24d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment