BACKPORT: FROMLIST: usb: dwc3: gadget: Clear DEP flags after stop transfers in ep disable

Ensure that dep->flags are cleared until after stop active transfers
is completed.  Otherwise, the ENDXFER command will not be executed
during ep disable.

Fixes: f09ddcfcb8 ("usb: dwc3: gadget: Prevent EP queuing while stopping transfers")
Reported-and-tested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>

Bug: 183733328
Link: https://lore.kernel.org/linux-usb/1616610664-16495-1-git-send-email-wcheng@codeaurora.org/
Change-Id: Ib8027747af37d7c977ea6cc1b00b1977f81da138
Signed-off-by: Wesley Cheng <wcheng@codeaurora.org>
This commit is contained in:
Wesley Cheng
2021-03-24 10:54:34 -07:00
committed by Greg Kroah-Hartman
parent dcf3827b8b
commit 76284302b6

View File

@@ -789,10 +789,6 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
reg &= ~DWC3_DALEPENA_EP(dep->number);
dwc3_writel(dwc->regs, DWC3_DALEPENA, reg);
dep->stream_capable = false;
dep->type = 0;
dep->flags = 0;
/* Clear out the ep descriptors for non-ep0 */
if (dep->number > 1) {
dep->endpoint.comp_desc = NULL;
@@ -801,6 +797,10 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep)
dwc3_remove_requests(dwc, dep);
dep->stream_capable = false;
dep->type = 0;
dep->flags = 0;
return 0;
}