From 75572d37b68092acf0df914a44e1bdccb643549a Mon Sep 17 00:00:00 2001 From: Jianwei Zheng Date: Fri, 12 Aug 2022 09:53:58 +0800 Subject: [PATCH] phy: rockchip-inno-usb2: fix dwc2 init failed due to core soft reset timeout Dwc2 controller will call phy init function during probe, Current code will schedule otg_sm_work immediately after phy init, if we don't plug in usb cable at this time, phy will power off soon after, this will cause dwc2 do core soft reset failed. To resolve this problem, We use typec_vbus_det property to distinguish whether otg_sm_work needs to be executed immediately, If not needed, delay 1 second. Signed-off-by: Jianwei Zheng Change-Id: I191c8f2b83673e8712afea1d642224ae1ae2eb97 --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 0b39eca8f83f..c234b9ddedad 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -774,8 +774,8 @@ static int rockchip_usb2phy_init(struct phy *phy) "failed to enable bvalid irq\n"); goto out; } - - schedule_delayed_work(&rport->otg_sm_work, 0); + schedule_delayed_work(&rport->otg_sm_work, + rport->typec_vbus_det ? 0 : OTG_SCHEDULE_DELAY); } } else if (rport->port_id == USB2PHY_PORT_HOST) { if (rport->port_cfg->disfall_en.offset) {