From 8c47ad3c7ba260eca23aedb4d2b706be558d0320 Mon Sep 17 00:00:00 2001 From: William Wu Date: Thu, 19 Jul 2018 10:51:41 +0800 Subject: [PATCH] usb: dwc3: rockchip: Don't reset otg logic if device connect During dwc3 resume, it shoudn't reset otg controller logic if device is connecting with the otg port, because it will cause device to be reenumerated. More seriously, it may cause the otg_work to enter disconnect process and power down usb3 controller power domain, at the same time, if the xHCI driver is accessing the controller asynchronously, it will cause system hang. Change-Id: Id546277bd4082b7baeff830788643a800330ae8e Signed-off-by: William Wu --- drivers/usb/dwc3/dwc3-rockchip.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index afdb6cb1f437..db482d37df56 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -969,9 +969,11 @@ static int __maybe_unused dwc3_rockchip_resume(struct device *dev) struct dwc3_rockchip *rockchip = dev_get_drvdata(dev); struct dwc3 *dwc = rockchip->dwc; - reset_control_assert(rockchip->otg_rst); - udelay(1); - reset_control_deassert(rockchip->otg_rst); + if (!rockchip->connected) { + reset_control_assert(rockchip->otg_rst); + udelay(1); + reset_control_deassert(rockchip->otg_rst); + } rockchip->suspended = false;