summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2011-08-19 17:59:12 (GMT)
committerFelipe Balbi <balbi@ti.com>2011-09-09 10:01:54 (GMT)
commit0d2f4758530d1598087d1d2f3e75b4f7d17fc6c7 (patch)
tree28fd0bb2e8574f61ae84be00b8d338faf5815610 /drivers/usb/dwc3
parent55a46269ccedec140e2487a2344e8a247d48b385 (diff)
downloadlinux-0d2f4758530d1598087d1d2f3e75b4f7d17fc6c7.tar.xz
usb: dwc3: gadget: fixing dequeue of TRBs
A TRB which is dequeued seems to have its HWO bits set to 1. Therefore we ignore it if we dequeue it after the command is completed. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/dwc3')
-rw-r--r--drivers/usb/dwc3/gadget.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index cebaef7..56f0e46 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1309,11 +1309,17 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
dwc3_trb_to_nat(req->trb, &trb);
- if (trb.hwo) {
+ if (trb.hwo && status != -ESHUTDOWN)
+ /*
+ * We continue despite the error. There is not much we
+ * can do. If we don't clean in up we loop for ever. If
+ * we skip the TRB than it gets overwritten reused after
+ * a while since we use them in a ring buffer. a BUG()
+ * would help. Lets hope that if this occures, someone
+ * fixes the root cause instead of looking away :)
+ */
dev_err(dwc->dev, "%s's TRB (%p) still owned by HW\n",
dep->name, req->trb);
- continue;
- }
count = trb.length;
if (dep->direction) {