Commit d115d705 authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Felipe Balbi

Revert "usb: dwc3: gadget: drop unnecessary loop when cleaning up TRBs"

This reverts commit 8f2c9544.

As it breaks g_ether on my Baytrail FFRD8 device. Everything starts out
fine, but after a bit of data has been transferred it just stops
flowing.

Note that I do get a bunch of these "NOHZ: local_softirq_pending 08"
when booting the machine, but I'm not really sure if they're related
to this problem.

Cc: Felipe Balbi <balbi@ti.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e5f68b4a
...@@ -1884,27 +1884,32 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep, ...@@ -1884,27 +1884,32 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
unsigned int i; unsigned int i;
int ret; int ret;
req = next_request(&dep->req_queued);
if (!req) {
WARN_ON_ONCE(1);
return 1;
}
i = 0;
do { do {
slot = req->start_slot + i; req = next_request(&dep->req_queued);
if ((slot == DWC3_TRB_NUM - 1) && if (!req) {
WARN_ON_ONCE(1);
return 1;
}
i = 0;
do {
slot = req->start_slot + i;
if ((slot == DWC3_TRB_NUM - 1) &&
usb_endpoint_xfer_isoc(dep->endpoint.desc)) usb_endpoint_xfer_isoc(dep->endpoint.desc))
slot++; slot++;
slot %= DWC3_TRB_NUM; slot %= DWC3_TRB_NUM;
trb = &dep->trb_pool[slot]; trb = &dep->trb_pool[slot];
ret = __dwc3_cleanup_done_trbs(dwc, dep, req, trb,
event, status);
if (ret)
break;
} while (++i < req->request.num_mapped_sgs);
dwc3_gadget_giveback(dep, req, status);
ret = __dwc3_cleanup_done_trbs(dwc, dep, req, trb,
event, status);
if (ret) if (ret)
break; break;
} while (++i < req->request.num_mapped_sgs); } while (1);
dwc3_gadget_giveback(dep, req, status);
if (usb_endpoint_xfer_isoc(dep->endpoint.desc) && if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
list_empty(&dep->req_queued)) { list_empty(&dep->req_queued)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment