usb: dwc3: ep0: make sure to reinitilize ep1 on STALL
authorFelipe Balbi <balbi@ti.com>
Mon, 23 Jul 2012 06:07:41 +0000 (09:07 +0300)
committerFelipe Balbi <balbi@ti.com>
Fri, 3 Aug 2012 06:28:28 +0000 (09:28 +0300)
When issuing SetStall on ep0, we must make sure to
reinitialize all flags on physical ep1 too.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/ep0.c

index 3f2c698a2bd16a8e35c13c6f6bd9d7be0ee24a53..1bba97ba218d7b3fd1e39be7c133a6760aa1d95e 100644 (file)
@@ -262,9 +262,14 @@ out:
 
 static void dwc3_ep0_stall_and_restart(struct dwc3 *dwc)
 {
-       struct dwc3_ep          *dep = dwc->eps[0];
+       struct dwc3_ep          *dep;
+
+       /* reinitialize physical ep1 */
+       dep = dwc->eps[1];
+       dep->flags = DWC3_EP_ENABLED;
 
        /* stall is always issued on EP0 */
+       dep = dwc->eps[0];
        __dwc3_gadget_ep_set_halt(dep, 1);
        dep->flags = DWC3_EP_ENABLED;
        dwc->delayed_status = false;