summaryrefslogtreecommitdiffstats
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-04-16 10:30:33 -0500
committerFelipe Balbi <balbi@ti.com>2014-04-16 10:30:33 -0500
commit687ef9817df7ed960d14575b9033dde3d04631fe (patch)
tree376c33075dc68bd6327fbed471b627c78c44d34f /drivers/usb/dwc3
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5 (diff)
downloadblackbird-op-linux-687ef9817df7ed960d14575b9033dde3d04631fe.tar.gz
blackbird-op-linux-687ef9817df7ed960d14575b9033dde3d04631fe.zip
usb: dwc3: gadget: clear stall when disabling endpoint
so it seems like DWC3 IP doesn't clear stalls automatically when we disable an endpoint, because of that, we _must_ make sure stalls are cleared before clearing the proper bit in DALEPENA register. Cc: <stable@vger.kernel.org> # v3.4+ Reported-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index a740eac74d56..f0dc0ee85ded 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -608,6 +608,10 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
dwc3_remove_requests(dwc, dep);
+ /* make sure HW endpoint isn't stalled */
+ if (dep->flags & DWC3_EP_STALL)
+ __dwc3_gadget_ep_set_halt(dep, 0);
+
reg = dwc3_readl(dwc->regs, DWC3_DALEPENA);
reg &= ~DWC3_DALEPENA_EP(dep->number);
dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
OpenPOWER on IntegriCloud