usb: dwc2: gadget: Fix issue in dwc2_gadget_start_isoc()

From: Zengtao (B) <hidden>
Date: 2018-06-14 03:45:39

Hi Minas:
quoted hunk
-----Original Message-----
From: linux-usb-owner@vger.kernel.org
[mailto:linux-usb-owner@vger.kernel.org] On Behalf Of Minas Harutyunyan
Sent: Tuesday, June 12, 2018 4:37 PM
To: Felipe Balbi <balbi@kernel.org>; Greg Kroah-Hartman
[off-list ref]; Minas Harutyunyan
[off-list ref]; linux-usb@vger.kernel.org
Cc: John Youn <redacted>
Subject: [PATCH] usb: dwc2: gadget: Fix issue in dwc2_gadget_start_isoc()

In case of requests queue is empty reset EP target_frame to initial value.

This allow restarting ISOC traffic in case when function driver queued
requests with interruptions.

Signed-off-by: Minas Harutyunyan <hminas@synopsys.com>
---
drivers/usb/dwc2/gadget.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c index
7a5e265f48f7..24d23025be77 100644
--- a/drivers/usb/dwc2/gadget.c
+++ b/drivers/usb/dwc2/gadget.c
@@ -891,6 +891,7 @@ static void dwc2_gadget_start_isoc_ddma(struct
dwc2_hsotg_ep *hs_ep)
	struct dwc2_dma_desc *desc;

	if (list_empty(&hs_ep->queue)) {
+		hs_ep->target_frame = TARGET_FRAME_INITIAL;
		dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__);
		return;
	}
--
Tested-by: Zeng Tao <redacted>

I have tested it on my platform using webcam gadget application.

Regards
Zengtao 

2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in the
body of a message to majordomo@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help