From a43c9c3095ee7fbdd90d50a5e5e9901d4906e8dd Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Tue, 11 Oct 2016 17:40:19 +0800 Subject: [PATCH] usb: dwc3: rockchip: set dwc3 enter runtime suspend immediately In current code, the dwc3 controller is active when system start and change to suspend when auto suspend, while the dwc3 controller will receive connected notify before auto suspend and fail to change the state of dwc3 controller from active state to resume if dwc3 controller is connected when system start. So we can change async suspend to sysc suspend to make sure that the dwc3 controller could finish suspend process before receive connect notify and fix "set address fail" error when system start. Change-Id: Ida8760004da06275d667e33b887b8dde87cd9520 Signed-off-by: Meng Dongyang --- drivers/usb/dwc3/dwc3-rockchip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index 323d7ef402f6..1d0c2279feeb 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -392,10 +392,6 @@ static int dwc3_rockchip_probe(struct platform_device *pdev) goto err2; if (rockchip->edev) { - pm_runtime_set_autosuspend_delay(&child_pdev->dev, - DWC3_ROCKCHIP_AUTOSUSPEND_DELAY); - pm_runtime_allow(&child_pdev->dev); - if (rockchip->dwc->dr_mode == USB_DR_MODE_HOST || rockchip->dwc->dr_mode == USB_DR_MODE_OTG) { struct usb_hcd *hcd = @@ -411,6 +407,10 @@ static int dwc3_rockchip_probe(struct platform_device *pdev) } } + pm_runtime_set_autosuspend_delay(&child_pdev->dev, + DWC3_ROCKCHIP_AUTOSUSPEND_DELAY); + pm_runtime_allow(&child_pdev->dev); + pm_runtime_suspend(&child_pdev->dev); pm_runtime_put_sync(dev); if ((extcon_get_cable_state_(rockchip->edev, -- 2.34.1