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)
committerSasha Levin <alexander.levin@verizon.com>
Wed, 31 Aug 2016 23:21:09 +0000 (19:21 -0400)
[ Upstream commit 7c705dfe2ebe731c8fd068623b6b4df2d3512c08 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/usb/dwc3/gadget.c

index abc39869e78202e2c8a3d489c6eb7adeca22d2ce..a5e1b8b39ff57eab14d7161071653a1c5727b71a 100644 (file)
@@ -1881,7 +1881,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 |