Skip to content

Commit ac55d16

Browse files
ADESTMgregkh
authored andcommitted
usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend
Calling dwc2_hsotg_ep_disable on ep0 (in/out) will lead to the following logs before returning -EINVAL: dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0 dwc2 49000000.usb-otg: dwc2_hsotg_ep_disable: called for ep0 To avoid these two logs while suspending, start disabling the endpoint from the index 1, as done in dwc2_hsotg_udc_stop: /* all endpoints should be shutdown */ for (ep = 1; ep < hsotg->num_of_eps; ep++) { if (hsotg->eps_in[ep]) dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep); if (hsotg->eps_out[ep]) dwc2_hsotg_ep_disable_lock(&hsotg->eps_out[ep]->ep); } Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Amelie Delaunay <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 26d81b2 commit ac55d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/dwc2/gadget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5097,7 +5097,7 @@ int dwc2_hsotg_suspend(struct dwc2_hsotg *hsotg)
50975097
hsotg->gadget.speed = USB_SPEED_UNKNOWN;
50985098
spin_unlock_irqrestore(&hsotg->lock, flags);
50995099

5100-
for (ep = 0; ep < hsotg->num_of_eps; ep++) {
5100+
for (ep = 1; ep < hsotg->num_of_eps; ep++) {
51015101
if (hsotg->eps_in[ep])
51025102
dwc2_hsotg_ep_disable_lock(&hsotg->eps_in[ep]->ep);
51035103
if (hsotg->eps_out[ep])

0 commit comments

Comments
 (0)