]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "usb: dwc3: gadget: drop unnecessary loop when cleaning up TRBs"
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 31 Aug 2015 16:48:28 +0000 (19:48 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2015 19:34:35 +0000 (14:34 -0500)
commit d115d7050a0d2c4967532f18c9cb522fea6b7280 upstream.

This reverts commit 8f2c9544aba636134303105ecb164190a39dece4.

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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/gadget.c

index 1e8bdf8178113af9db2c556488224acf6504e853..11784de01ca88a8738f29c09c1f51ac92ccbecb7 100644 (file)
@@ -1872,27 +1872,32 @@ static int dwc3_cleanup_done_reqs(struct dwc3 *dwc, struct dwc3_ep *dep,
        unsigned int            i;
        int                     ret;
 
-       req = next_request(&dep->req_queued);
-       if (!req) {
-               WARN_ON_ONCE(1);
-               return 1;
-       }
-       i = 0;
        do {
-               slot = req->start_slot + i;
-               if ((slot == DWC3_TRB_NUM - 1) &&
+               req = next_request(&dep->req_queued);
+               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))
-                       slot++;
-               slot %= DWC3_TRB_NUM;
-               trb = &dep->trb_pool[slot];
+                               slot++;
+                       slot %= DWC3_TRB_NUM;
+                       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)
                        break;
-       } while (++i < req->request.num_mapped_sgs);
-
-       dwc3_gadget_giveback(dep, req, status);
+       } while (1);
 
        if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
                        list_empty(&dep->req_queued)) {