usb: dwc3: gadget: Keep TRBs in request order
authorThinh Nguyen <Thinh.Nguyen@synopsys.com>
Thu, 1 Oct 2020 00:44:32 +0000 (17:44 -0700)
committerFelipe Balbi <balbi@kernel.org>
Fri, 2 Oct 2020 06:57:46 +0000 (09:57 +0300)
commit346a15cdf65263d8a8dfdbc5d2702471a2dcef6c
tree7ff47793daf89205902ee534ee655fb74d0120cf
parent8dbbe48c7a9989c75e39bfb2a886e163fa21660a
usb: dwc3: gadget: Keep TRBs in request order

If we couldn't finish preparing all the TRBs of a request, don't prepare
the next request. Otherwise, the TRBs order will be mixed up and the
controller will process the wrong TRB. This is a corner case where
there's not enough TRBs for a request that needs the extra TRB but
there's still 1 available TRB in the pool.

Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c