It's more safe to set PHY ready after soft reset done Let's consider a test case like this: I have a usb PHY which don't need SW initial before access it, But i have a wrong PHY clock default setting in PHY register which means PHY is not ready in fact. in dwc3_core_init, dwc3_core_get_phy will return 0 despite usb get PHYs with return -ENODEV, and set phys_ready=true but at this point, we can not say phys is ready or at least it not safe to do that. then, go on with dwc3_core_soft_reset,dwc3 reset core and PHY, as phy->init is NULL in this case, so, usb_phy_init do nothing and go on with a while loop which cost 1000* 20 ms, and return with -ETIMEDOUT check phys_ready is set to TRUE but actually not. Move phys_ready after soft reset done is more reasonable and don't see side-effect yet. Signed-off-by: Yuan Fang <yuan.fang@xxxxxxxxxxxxxxx> --- Hi, please take a look at issue description above and kindly review this CL if any side-effect, many thanks. B.R Yuan Fang drivers/usb/dwc3/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index b6e53d8212cd..04b1bbaf694a 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -324,6 +324,7 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) if (DWC3_VER_IS_WITHIN(DWC31, ANY, 180A)) msleep(50); + dwc->phys_ready = true; return 0; } @@ -979,7 +980,6 @@ static int dwc3_core_init(struct dwc3 *dwc) ret = dwc3_core_get_phy(dwc); if (ret) goto err0a; - dwc->phys_ready = true; } ret = dwc3_core_soft_reset(dwc); -- 2.17.1