Commit 1dcaa252 authored by Yunfan Zhang's avatar Yunfan Zhang Committed by Felipe Balbi

usb: gadget: mv_udc: fix hang when shutdown

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: default avatarYunfan Zhang <yfzhang@marvell.com>
Signed-off-by: default avatarNeil Zhang <zhangwm@marvell.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 60326ce3
...@@ -2501,9 +2501,11 @@ static void mv_udc_shutdown(struct platform_device *dev) ...@@ -2501,9 +2501,11 @@ static void mv_udc_shutdown(struct platform_device *dev)
u32 mode; u32 mode;
/* reset controller mode to IDLE */ /* reset controller mode to IDLE */
mv_udc_enable(udc);
mode = readl(&udc->op_regs->usbmode); mode = readl(&udc->op_regs->usbmode);
mode &= ~3; mode &= ~3;
writel(mode, &udc->op_regs->usbmode); writel(mode, &udc->op_regs->usbmode);
mv_udc_disable(udc);
} }
static struct platform_driver udc_driver = { static struct platform_driver udc_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment