Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0ad85ae authored by Felipe Balbi's avatar Felipe Balbi
Browse files

usb: dwc3: gadget: stop processing on HWO set



stop consuming TRBs when we reach one with HWO bit
already set. This will prevent us from prematurely
retiring a TRB.

Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 79d17482
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -1979,16 +1979,7 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep,
		trb->ctrl &= ~DWC3_TRB_CTRL_HWO;

	if ((trb->ctrl & DWC3_TRB_CTRL_HWO) && status != -ESHUTDOWN)
		/*
		 * We continue despite the error. There is not much we
		 * can do. If we don't clean it up we loop forever. If
		 * we skip the TRB then it gets overwritten after a
		 * while since we use them in a ring buffer. A BUG()
		 * would help. Lets hope that if this occurs, someone
		 * fixes the root cause instead of looking away :)
		 */
		dev_err(dwc->dev, "%s's TRB (%p) still owned by HW\n",
				dep->name, trb);
		return 1;

	count = trb->size & DWC3_TRB_SIZE_MASK;