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.
Change-Id: I2835435200bca4086d34c0dfb6e88da473dfff1f
Signed-off-by:
Dixon Peterson <dixonp@codeaurora.org>
Loading
Please register or sign in to comment