aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3/gadget.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/dwc3/gadget.c')
-rw-r--r--drivers/usb/dwc3/gadget.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index b5d95f8329f..0c934a195de 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -872,8 +872,14 @@ int __dwc3_gadget_ep_set_halt(struct dwc3_ep *dep, int value)
872 memset(&params, 0x00, sizeof(params)); 872 memset(&params, 0x00, sizeof(params));
873 873
874 if (value) { 874 if (value) {
875 if (dep->number == 0 || dep->number == 1) 875 if (dep->number == 0 || dep->number == 1) {
876 dwc->ep0state = EP0_STALL; 876 /*
877 * Whenever EP0 is stalled, we will restart
878 * the state machine, thus moving back to
879 * Setup Phase
880 */
881 dwc->ep0state = EP0_SETUP_PHASE;
882 }
877 883
878 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, 884 ret = dwc3_send_gadget_ep_cmd(dwc, dep->number,
879 DWC3_DEPCMD_SETSTALL, &params); 885 DWC3_DEPCMD_SETSTALL, &params);