From 78c5b7ae9fcd37dd6ea7423a2a1808ea19d72124 Mon Sep 17 00:00:00 2001 From: William Wu Date: Mon, 31 May 2021 12:48:28 +0800 Subject: [PATCH] usb: dwc3: gadget: fix XferInProgress event for isoc ep On XferInProgress events, if the endpoint is isochronous type, do not kick transfer directly even if the pending_list isn't empty. Because it needs to wait for XferNotReady event to start isoc transfer. Without this patch, it will trigger a large number of unuseful XferInProgress events, and easily cause loss of synchronization data if the cpu core unable to handle the dwc3 thread interrupt in time. Fixes: b77df211071a ("usb: dwc3: gadget: Continue to process pending requests") Change-Id: I14d16240a6e10db466fd9822b4fdc35d79817508 Signed-off-by: William Wu --- drivers/usb/dwc3/gadget.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index eec38152ed3e..c09eb92aca05 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2922,7 +2922,8 @@ static void dwc3_gadget_endpoint_transfer_in_progress(struct dwc3_ep *dep, if (event->status & DEPEVT_STATUS_MISSED_ISOC && list_empty(&dep->started_list)) dwc3_stop_active_transfer(dep, true, true); - else if (dwc3_gadget_ep_should_continue(dep)) + else if (!usb_endpoint_xfer_isoc(dep->endpoint.desc) && + dwc3_gadget_ep_should_continue(dep)) __dwc3_gadget_kick_transfer(dep); /*