aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorNeil Zhang <zhangwm@marvell.com>2012-07-09 22:07:07 -0400
committerFelipe Balbi <balbi@ti.com>2012-08-23 04:04:17 -0400
commit11c37c8b64b9d9d4ab19d387e6028eee3ec188d3 (patch)
treec346f8d7afdcdc22deac0b18e1cd627cc83fce31 /drivers/usb
parent1dcaa252fdf01e4ba49ece156812043baf01c7cc (diff)
usb: gadget: mv_udc: fix boot up hang
Fix boot up hang when enable udc without otg enabled. The root cause is that the clock will be shut down when probe routine is finished because of clock gating. When a gadget driver is registered at this time, it will call mv_udc_start which in turn will call mv_udc_vbus_session. If there is no cable attached at the boot up time, the vbus is low, so it will call stop_activity path without clock enabled which will cause system hang then. Actually, we need't go this path when clock is disabled, what we need to do is just jump out. Signed-off-by: Neil Zhang <zhangwm@marvell.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/mv_udc_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index 58edff9abcef..ad91de4d60d8 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -1221,12 +1221,16 @@ static int mv_udc_vbus_session(struct usb_gadget *gadget, int is_active)
1221 udc_start(udc); 1221 udc_start(udc);
1222 } 1222 }
1223 } else if (udc->driver && udc->softconnect) { 1223 } else if (udc->driver && udc->softconnect) {
1224 if (!udc->active)
1225 goto out;
1226
1224 /* stop all the transfer in queue*/ 1227 /* stop all the transfer in queue*/
1225 stop_activity(udc, udc->driver); 1228 stop_activity(udc, udc->driver);
1226 udc_stop(udc); 1229 udc_stop(udc);
1227 mv_udc_disable(udc); 1230 mv_udc_disable(udc);
1228 } 1231 }
1229 1232
1233out:
1230 spin_unlock_irqrestore(&udc->lock, flags); 1234 spin_unlock_irqrestore(&udc->lock, flags);
1231 return retval; 1235 return retval;
1232} 1236}