This series contains miscellaneous fixes to dwc3's gadget. Most of them are related to transfer cancellation handling.
Thinh Nguyen (6): usb: dwc3: gadget: Don't clear flags before transfer ended usb: dwc3: gadget: Properly handle ClearFeature(halt) usb: dwc3: gadget: Wrap around when skip TRBs usb: dwc3: gadget: Give back staled requests usb: dwc3: gadget: Remove unnecessary checks usb: dwc3: gadget: Refactor dwc3_gadget_ep_dequeue
drivers/usb/dwc3/gadget.c | 85 +++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 28 deletions(-)
When skipping TRBs, we need to account for wrapping around the ring buffer and not modifying some invalid TRBs. Without this fix, dwc3 won't be able to check for available TRBs.
Cc: stable stable@vger.kernel.org Fixes: 7746a8dfb3f9 ("usb: dwc3: gadget: extract dwc3_gadget_ep_skip_trbs()") Signed-off-by: Thinh Nguyen thinhn@synopsys.com --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 21b10364b888..8c27c6ede7c4 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1518,7 +1518,7 @@ static void dwc3_gadget_ep_skip_trbs(struct dwc3_ep *dep, struct dwc3_request *r for (i = 0; i < req->num_trbs; i++) { struct dwc3_trb *trb;
- trb = req->trb + i; + trb = &dep->trb_pool[dep->trb_dequeue]; trb->ctrl &= ~DWC3_TRB_CTRL_HWO; dwc3_ep_inc_deq(dep); }
linux-stable-mirror@lists.linaro.org