mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
Merge "usb: dwc3: gadget: Give back staled requests"
This commit is contained in:
commit
32b9fcd606
1 changed files with 14 additions and 1 deletions
|
|
@ -1682,6 +1682,11 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
|
|||
|
||||
spin_lock_irqsave(&dwc->lock, flags);
|
||||
|
||||
list_for_each_entry(r, &dep->cancelled_list, list) {
|
||||
if (r == req)
|
||||
goto out0;
|
||||
}
|
||||
|
||||
list_for_each_entry(r, &dep->pending_list, list) {
|
||||
if (r == req)
|
||||
break;
|
||||
|
|
@ -1693,13 +1698,21 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
|
|||
break;
|
||||
}
|
||||
if (r == req) {
|
||||
struct dwc3_request *t;
|
||||
|
||||
/* wait until it is processed */
|
||||
dwc3_stop_active_transfer(dep, true, true);
|
||||
|
||||
if (!r->trb)
|
||||
goto out0;
|
||||
|
||||
dwc3_gadget_move_cancelled_request(req);
|
||||
/*
|
||||
* Remove any started request if the transfer is
|
||||
* cancelled.
|
||||
*/
|
||||
list_for_each_entry_safe(r, t, &dep->started_list, list)
|
||||
dwc3_gadget_move_cancelled_request(r);
|
||||
|
||||
if (dep->flags & DWC3_EP_TRANSFER_STARTED)
|
||||
goto out0;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in a new issue