usb: dwc3: gadget: always cleanup all TRBs
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 10 Aug 2016 09:35:30 +0000 (12:35 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 10 Aug 2016 11:15:57 +0000 (14:15 +0300)
If we stop earlier due to short packet, we will
not be able to giveback all TRBs.

Cc: <stable@vger.kernel.org>
Cc: Brian E Rogers <brian.e.rogers@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/gadget.c

index 241f5c7b34bf630ff41241c89f0b23ba2dbd7925..eb820e4ab49d20f1a8526a48037c3ac78a365342 100644 (file)
@@ -2028,7 +2028,7 @@ static int __dwc3_cleanup_done_trbs(struct dwc3 *dwc, struct dwc3_ep *dep,
                        s_pkt = 1;
        }
 
-       if (s_pkt)
+       if (s_pkt && !chain)
                return 1;
        if ((event->status & DEPEVT_STATUS_LST) &&
                        (trb->ctrl & (DWC3_TRB_CTRL_LST |