summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2018-01-18 00:22:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-05-25 17:17:36 +0300
commite8f101ec20c09be9f8635ac053bd2a5dff22482c (patch)
treee60cf2e5e871504c140155cca6577da5f517de7b /drivers/usb/dwc3
parent0cc948e8ddb5dab378a2648f384dd87350aa7776 (diff)
downloadlinux-e8f101ec20c09be9f8635ac053bd2a5dff22482c.tar.xz
usb: dwc3: Undo PHY init if soft reset fails
[ Upstream commit 00b42170c86f90ac9dea83a7dfcd3f0c38098fe2 ] In this function, we init the USB2 and USB3 PHYs, but if soft reset times out, we don't unwind this. Noticed by inspection. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index c3f3f1a89b0f..280b9ae0a25c 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -248,6 +248,9 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
udelay(1);
} while (--retries);
+ phy_exit(dwc->usb3_generic_phy);
+ phy_exit(dwc->usb2_generic_phy);
+
return -ETIMEDOUT;
}