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:Dixon Peterson <dixonp@codeaurora.org> Change-Id: I8f45d1e88317e2da1f9498cce8b5e8666e58dd2e Signed-off-by:
Neha Pandey <nehap@codeaurora.org>
Loading
Please sign in to comment