tenderloin usb: fix release of wakelock
The msm_otg wakelock can get 'stuck' in some cases. In particular,
when Touchpad is placed on Touchstone charger when the Touchpad
is in deep-sleep. This should allow for proper release of the
msm_otg wakelock in that and similar cases.
diff --git a/drivers/usb/otg/msm72k_otg.c b/drivers/usb/otg/msm72k_otg.c
index 4b1596c..c95905e 100644
--- a/drivers/usb/otg/msm72k_otg.c
+++ b/drivers/usb/otg/msm72k_otg.c
@@ -956,6 +956,11 @@
wake_lock_timeout(&dev->wlock, msecs_to_jiffies(2000));
}
+ if (!work_pending(&dev->sm_work) && !hrtimer_active(&dev->timer) &&
+ !work_pending(&dev->otg_resume_work)) {
+ wake_lock_timeout(&dev->wlock, msecs_to_jiffies(2000));
+ }
+
/* Enable irq which was disabled before scheduling this work.
* But don't release wake_lock, as we got async interrupt and
* there will be some work pending for OTG state machine.