usb: gadget: Resume usb bus on reset
usb: gadget: Resume usb bus on reset

When receiving reset interrupt from the usb controller, check if the bus
is suspended. If so then first resume the bus and only then reset
the usb controller.

This fixes a case of race condition when reset
interrupt is happening right after suspend interrupt. In this case
there might be a race in which the msm_otg will execute the suspend
event in the work queue after the reset interrupt finished. In this case
the bus will be suspended after the reset and no further event
(resume/reset) will arrive from host, keeping the device in LPM forever.

Change-Id: Ifd4bee52eb42c3313821a799a935539d1789d42e
CRs-Fixed: 381806, 386464
Signed-off-by: Ido Shayevitz <c55d109aa4fa626d00b3c6a0adc354c70612f8d6@codeaurora.org>

TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas