usb: dwc3: gadget: Move all started reqs to cancelled list on dequeue

If a request is dequeued, the transfer is cancelled.
Give back all the started requests.

Fixes: 2007d5815e ("usb: dwc3: gadget: properly skip over trbs on ep_dequeue")
Change-Id: I7a4d4e58435fb630681891a79bd5e04c19dbbdbd
Signed-off-by: William Wu <william.wu@rock-chips.com>
This commit is contained in:
William Wu
2024-04-15 10:49:17 +08:00
committed by Tao Huang
parent 307db3a0b5
commit 8d733347b8

View File

@@ -2254,6 +2254,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
list_for_each_entry(r, &dep->started_list, list) {
if (r == req) {
struct dwc3_request *t;
/* wait until it is processed */
dwc3_stop_active_transfer(dep, true, true);
@@ -2261,7 +2263,10 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
* Remove any started request if the transfer is
* cancelled.
*/
dwc3_gadget_move_cancelled_request(r, DWC3_REQUEST_STATUS_DEQUEUED);
list_for_each_entry_safe(r, t, &dep->started_list, list) {
dwc3_gadget_move_cancelled_request(r,
DWC3_REQUEST_STATUS_DEQUEUED);
}
dep->flags &= ~DWC3_EP_WAIT_TRANSFER_COMPLETE;