Patchwork [v7,07/10] usb: dwc3: check for requests in started list for stream capable endpoints

login
register
mail settings
Submitter Anurag Kumar Vulisha
Date Dec. 1, 2018, 11:13 a.m.
Message ID <1543662811-5194-8-git-send-email-anurag.kumar.vulisha@xilinx.com>
Download mbox | patch
Permalink /patch/669735/
State New
Headers show

Comments

Anurag Kumar Vulisha - Dec. 1, 2018, 11:13 a.m.
For stream capable endpoints, uas layer can queue mulpile requests on
single ep with different stream ids. So, there can be multiple pending
requests waiting to be transferred. This patch changes the code to check
for any pending requests waiting to be transferred on ep started_list and
calls __dwc3_gadget_kick_transfer() if any.

Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>
---
 Changes in v7:
	1. Reverted to dep->stream_capable from dep->endpoint.stream_caapable

 Changes in v6:
	1. Replaced dep->stream_capable with dep->endpoint.stream_caapable

 Changes in v5:
	1. None

 Changes in v4:
	1. None

 Changes in v3:
	1. None

 Changes in v2:
	1. None
---
 drivers/usb/dwc3/gadget.c | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index 78c9bc6..d0de7dc 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -2413,6 +2413,9 @@  static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep,
 
 	dwc3_gadget_ep_cleanup_completed_requests(dep, event, status);
 
+	if (dep->stream_capable && !list_empty(&dep->started_list))
+		__dwc3_gadget_kick_transfer(dep);
+
 	if (stop) {
 		dwc3_stop_active_transfer(dep, true);
 		dep->flags = DWC3_EP_ENABLED;