From bfc9c2149e94c27382edf8a62382b0bdc293bb40 Mon Sep 17 00:00:00 2001 From: Frank Wang Date: Wed, 22 Sep 2021 17:33:07 +0800 Subject: [PATCH] usb: dwc3: core: fix runtime suspend at probe Just put runtime suspend synchronously for otg mode at dwc3 probe time. We found that the USB3.0 HUB which integrated in rk3399-evb-ind board could not be enumerated at the system boot time, and the reason is the USB controller has been suspended when the HUB gets ready. Fixes: d8b7417beaa3e ("usb: dwc3: core: allow pm runtime for rockchip platform") Signed-off-by: Frank Wang Change-Id: I19600f327d97cb992994d280645a00069dc9e8d2 --- drivers/usb/dwc3/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 3c9ab4930ca4..d4ce65859b4d 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1661,7 +1661,8 @@ static int dwc3_probe(struct platform_device *pdev) dwc3_debugfs_init(dwc); - if (of_device_is_compatible(dev->parent->of_node, + if (dwc->dr_mode == USB_DR_MODE_OTG && + of_device_is_compatible(dev->parent->of_node, "rockchip,rk3399-dwc3")) { pm_runtime_allow(dev); pm_runtime_put_sync_suspend(dev);