From 1dcaa252fdf01e4ba49ece156812043baf01c7cc Mon Sep 17 00:00:00 2001 From: Yunfan Zhang Date: Tue, 10 Jul 2012 10:07:06 +0800 Subject: [PATCH] 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: Yunfan Zhang Signed-off-by: Neil Zhang Signed-off-by: Felipe Balbi --- drivers/usb/gadget/mv_udc_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index ff6154d1816..58edff9abce 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c @@ -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 = { -- 2.20.1