Skip to contentSkip to conversation

usb: dwc3: Fix error handling for core init

PATCH Superseded Vivek Gautam 2 participants 4 messages Oct 21, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc3: Fix error handling for core init

Fixing the sequence of events in dwc3_core_init() error exit path. dwc3_core_exit() call is removed from the error path since, whatever it's doing is already done.

---

Based on usb-next.

 drivers/usb/dwc3/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/dwc3/core.c +2 -3
index 7287a76..fea4469 100644
@@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc)
 	return 0;
 
 err4:
-	phy_power_off(dwc->usb2_generic_phy);
+	phy_power_off(dwc->usb3_generic_phy);
 
 err3:
-	phy_power_off(dwc->usb3_generic_phy);
+	phy_power_off(dwc->usb2_generic_phy);
 
 err2:
 	usb_phy_set_suspend(dwc->usb2_phy, 1);
 	usb_phy_set_suspend(dwc->usb3_phy, 1);
-	dwc3_core_exit(dwc);
 
 err1:
 	usb_phy_shutdown(dwc->usb2_phy);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
#1 lore raw

Hi,

Quoted 6 lines · Vivek Gautam

Fixing the sequence of events in dwc3_core_init() error exit path. dwc3_core_exit() call is removed from the error path since, whatever it's doing is already done.

Care to blame the original commit and Cc stable if applicable?

Signature · 1 line
balbi
#2 lore raw

Hi,

Quoted 4 lines · Felipe Balbi

Hi,

Vivek Gautam <[email protected]> writes:

Quoted 8 lines
Quoted 6 lines

Fixing the sequence of events in dwc3_core_init() error exit path. dwc3_core_exit() call is removed from the error path since, whatever it's doing is already done.

Care to blame the original commit and Cc stable if applicable?

Ok, will do that.

Thanks
Vivek

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
#3 lore raw

PATCH v2 1/1 usb: dwc3: Fix error handling for core init

Fixing the sequence of events in dwc3_core_init() error exit path. dwc3_core_exit() call is also removed from the error path since, whatever it's doing is already done.

Fixes c499ff7 usb: dwc3: core: re-factor init and exit paths
Cc Felipe Balbi <[email protected]>
Cc Greg KH <[email protected]>
Cc Stable <[email protected]> # 4.8+

---

Based on usb-next.
Build tested.

Changes since v1:
- Added reference to original commit that this patch fixes.
- CC'ed kernel stable.

 drivers/usb/dwc3/core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/usb/dwc3/core.c +2 -3
index 7287a76..fea4469 100644
@@ -769,15 +769,14 @@ static int dwc3_core_init(struct dwc3 *dwc)
 	return 0;
 
 err4:
-	phy_power_off(dwc->usb2_generic_phy);
+	phy_power_off(dwc->usb3_generic_phy);
 
 err3:
-	phy_power_off(dwc->usb3_generic_phy);
+	phy_power_off(dwc->usb2_generic_phy);
 
 err2:
 	usb_phy_set_suspend(dwc->usb2_phy, 1);
 	usb_phy_set_suspend(dwc->usb3_phy, 1);
-	dwc3_core_exit(dwc);
 
 err1:
 	usb_phy_shutdown(dwc->usb2_phy);
Signature · 2 lines
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project