summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-04-16 10:30:33 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-06-30 20:11:53 -0700
commit0d8b12fce9dc5fcb05adeae1e39924b746a68685 (patch)
treea59d314a5eaabd145fa9aa507e89ecb6c1cbed1a /drivers
parent2e739000204f883d8708d2855d57a051c9da66db (diff)
downloadlwn-0d8b12fce9dc5fcb05adeae1e39924b746a68685.tar.gz
lwn-0d8b12fce9dc5fcb05adeae1e39924b746a68685.zip
usb: dwc3: gadget: clear stall when disabling endpoint
commit 687ef9817df7ed960d14575b9033dde3d04631fe upstream. 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. Reported-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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 2da0a5a2803a..09e9619ae381 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -586,6 +586,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);