summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinyu Chen <xinyu.chen@freescale.com>2012-09-12 11:00:11 +0800
committerXinyu Chen <xinyu.chen@freescale.com>2012-09-12 11:00:11 +0800
commit7358ff1bfa001581b852018facfb8782890a51aa (patch)
tree49e5be1197a79feb321a8ec72bbb457d0f137662
parent7782cf7ef2945c611283cb305560369e184d6e3f (diff)
ENGR00223230 android gadget: postpone the wake unlock in udc suspend
If in the early suspend mode without any other wakelock except the gadget one, user unplug the usb cable, the gadget udc suspend callback will be called, and it releases the wakelock immediately. At this time, the wake_unlock function will wakeup the suspend workqueue to do system suspend, and udc driver's status change can not be finished before suspend. This causes replug in the usb cable after resume, WinXP can not start the MTP correctly. Just re-lock that wakelock for about 500ms in the udc suspend callback does fix this issue. Signed-off-by: Xinyu Chen <xinyu.chen@freescale.com>
-rw-r--r--drivers/usb/gadget/android.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/gadget/android.c b/drivers/usb/gadget/android.c
index 24d3c5076241..369f499fbe00 100644
--- a/drivers/usb/gadget/android.c
+++ b/drivers/usb/gadget/android.c
@@ -1128,7 +1128,7 @@ static void android_disconnect(struct usb_gadget *gadget)
static void android_suspend(struct usb_gadget *gadget)
{
composite_suspend(gadget);
- wake_unlock(&wakelock);
+ wake_lock_timeout(&wakelock, HZ/2);
}
static void android_resume(struct usb_gadget *gadget)