diag: Do not write to USB when usb is disconnected

Diag driver tries to write to the USB from different workqueues.
The connect and the disconnect events happen in a different
workqueue. This can lead to a race conditon in setting the SMD
in_busy variables resulting in continuous reads, thereby queueing
up a lot USB writes. This patch protects the SMD in_busy
variables and reduces the latency of USB connect and disconnect
events.

Change-Id: Ia09a67c963749237c5e7471a5a9d3e2736c09c06
CRs-Fixed: 564562
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
3 files changed