Skip to content

Commit d57b026

Browse files
Fabrice Gasnierfourmone
authored andcommitted
Revert "usb: dwc2: drd: properly handle connector ID when the bus is suspended"
Since "usb: dwc2: drd: fix clock gating on USB role switch" it's redundant to queue a work that is going to call dwc2_conn_id_status_change(). It was used to exit the low power mode. It also caused dwc2_hsotg_core_connect() to be called. It also now cause the device to connect to the host, even if the gadget driver hasn't been configured. It results in the host not being able to enumerate: "device descriptor read/64, error -110". Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com> Change-Id: I9a3b9b112fcb6da23b5073e2fbaf0a48c6d2889b Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/linux-stm32/+/461203 ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com>
1 parent c2a4770 commit d57b026

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/usb/dwc2/drd.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,9 @@ static int dwc2_drd_role_sw_set(struct usb_role_switch *sw, enum usb_role role)
217217

218218
spin_unlock_irqrestore(&hsotg->lock, flags);
219219

220-
if (!already && hsotg->dr_mode == USB_DR_MODE_OTG) {
221-
/*
222-
* The bus may have been suspended (typically in hcd), need to resume as the HW
223-
* may not be HW accessible. Schedule work to call dwc2_conn_id_status_change
224-
* to handle the port resume before switching mode.
225-
*/
226-
if (hsotg->wq_otg)
227-
queue_work(hsotg->wq_otg, &hsotg->wf_otg);
228-
220+
if (!already && hsotg->dr_mode == USB_DR_MODE_OTG)
229221
/* This will raise a Connector ID Status Change Interrupt */
230222
dwc2_force_mode(hsotg, role == USB_ROLE_HOST);
231-
}
232223

233224
if (!hsotg->ll_hw_enabled && hsotg->clk)
234225
clk_disable_unprepare(hsotg->clk);

0 commit comments

Comments
 (0)