Loading drivers/usb/dwc3/core.c +30 −16 Original line number Diff line number Diff line Loading @@ -116,6 +116,33 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) return 0; } /** * dwc3_soft_reset - Issue soft reset * @dwc: Pointer to our controller context structure */ static int dwc3_soft_reset(struct dwc3 *dwc) { unsigned long timeout; u32 reg; timeout = jiffies + msecs_to_jiffies(500); dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); do { reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (!(reg & DWC3_DCTL_CSFTRST)) break; if (time_after(jiffies, timeout)) { dev_err(dwc->dev, "Reset Timed Out\n"); return -ETIMEDOUT; } cpu_relax(); } while (true); return 0; } /** * dwc3_free_one_event_buffer - Frees one event buffer * @dwc: Pointer to our controller context structure Loading Loading @@ -438,7 +465,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc) */ static int dwc3_core_init(struct dwc3 *dwc) { unsigned long timeout; u32 hwparams4 = dwc->hwparams.hwparams4; u32 reg; int ret; Loading Loading @@ -466,21 +492,9 @@ static int dwc3_core_init(struct dwc3 *dwc) } /* issue device SoftReset too */ timeout = jiffies + msecs_to_jiffies(500); dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); do { reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (!(reg & DWC3_DCTL_CSFTRST)) break; if (time_after(jiffies, timeout)) { dev_err(dwc->dev, "Reset Timed Out\n"); ret = -ETIMEDOUT; ret = dwc3_soft_reset(dwc); if (ret) goto err0; } cpu_relax(); } while (true); ret = dwc3_core_soft_reset(dwc); if (ret) Loading Loading
drivers/usb/dwc3/core.c +30 −16 Original line number Diff line number Diff line Loading @@ -116,6 +116,33 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc) return 0; } /** * dwc3_soft_reset - Issue soft reset * @dwc: Pointer to our controller context structure */ static int dwc3_soft_reset(struct dwc3 *dwc) { unsigned long timeout; u32 reg; timeout = jiffies + msecs_to_jiffies(500); dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); do { reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (!(reg & DWC3_DCTL_CSFTRST)) break; if (time_after(jiffies, timeout)) { dev_err(dwc->dev, "Reset Timed Out\n"); return -ETIMEDOUT; } cpu_relax(); } while (true); return 0; } /** * dwc3_free_one_event_buffer - Frees one event buffer * @dwc: Pointer to our controller context structure Loading Loading @@ -438,7 +465,6 @@ static void dwc3_phy_setup(struct dwc3 *dwc) */ static int dwc3_core_init(struct dwc3 *dwc) { unsigned long timeout; u32 hwparams4 = dwc->hwparams.hwparams4; u32 reg; int ret; Loading Loading @@ -466,21 +492,9 @@ static int dwc3_core_init(struct dwc3 *dwc) } /* issue device SoftReset too */ timeout = jiffies + msecs_to_jiffies(500); dwc3_writel(dwc->regs, DWC3_DCTL, DWC3_DCTL_CSFTRST); do { reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (!(reg & DWC3_DCTL_CSFTRST)) break; if (time_after(jiffies, timeout)) { dev_err(dwc->dev, "Reset Timed Out\n"); ret = -ETIMEDOUT; ret = dwc3_soft_reset(dwc); if (ret) goto err0; } cpu_relax(); } while (true); ret = dwc3_core_soft_reset(dwc); if (ret) Loading