usb: gadget: mv_udc: fix hang when shutdown
authorYunfan Zhang <yfzhang@marvell.com>
Tue, 10 Jul 2012 02:07:06 +0000 (10:07 +0800)
committerFelipe Balbi <balbi@ti.com>
Thu, 23 Aug 2012 08:04:16 +0000 (11:04 +0300)
Fix system hang in udc shutdown routine which caused by accessing usb
register when clock is disabled. So enable usb clock before access
register.

Signed-off-by: Yunfan Zhang <yfzhang@marvell.com>
Signed-off-by: Neil Zhang <zhangwm@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/mv_udc_core.c

index ff6154d1816eacb1e82945f9712f6268e92e4374..58edff9abcef28a483722fea817fc1b1a3265b6b 100644 (file)
@@ -2501,9 +2501,11 @@ static void mv_udc_shutdown(struct platform_device *dev)
        u32 mode;
 
        /* reset controller mode to IDLE */
+       mv_udc_enable(udc);
        mode = readl(&udc->op_regs->usbmode);
        mode &= ~3;
        writel(mode, &udc->op_regs->usbmode);
+       mv_udc_disable(udc);
 }
 
 static struct platform_driver udc_driver = {