Thread (4 messages) flat view 4 messages, 2 authors, 2021-01-05
STALE2073d LANDED

Landed in mainline as a5c7682aaaa1 on 2021-01-07.

[PATCH v2] usb: dwc3: gadget: Clear wait flag on dequeue

From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Date: 2021-01-05 06:43:41
Also in: stable
Subsystem: designware usb3 drd ip driver, the rest, usb subsystem · Maintainers: Thinh Nguyen, Linus Torvalds, Greg Kroah-Hartman

If an active transfer is dequeued, then the endpoint is freed to start a
new transfer. Make sure to clear the endpoint's transfer wait flag for
this case.

Cc: stable@vger.kernel.org
Fixes: e0d19563eb6c ("usb: dwc3: gadget: Wait for transfer completion")
Signed-off-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
---
 Changes in v2:
 - Only clear the wait flag if the selected request is of an active transfer.
   Otherwise, any dequeue will change the endpoint's state even if it's for
   some random request.

 drivers/usb/dwc3/gadget.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 78cb4db8a6e4..9a00dcaca010 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1763,6 +1763,8 @@ static int dwc3_gadget_ep_dequeue(struct usb_ep *ep,
 			list_for_each_entry_safe(r, t, &dep->started_list, list)
 				dwc3_gadget_move_cancelled_request(r);
 
+			dep->flags &= ~DWC3_EP_WAIT_TRANSFER_COMPLETE;
+
 			goto out;
 		}
 	}
base-commit: 2edc7af892d0913bf06f5b35e49ec463f03d5ed8
-- 
2.28.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help