Skip to content

Commit 041d81f

Browse files
author
Felipe Balbi
committed
usb: dwc3: gadget: fix 'endpoint always busy' bug
If a USB transfer has already been started, meaning we have already issued StartTransfer command to that particular endpoint, DWC3_EP_BUSY flag has also already been set. When we try to cancel this transfer which is already in controller's cache, we will not receive XferComplete event and we must clear DWC3_EP_BUSY in order to allow subsequent requests to be properly started. The best place to clear that flag is right after issuing DWC3_DEPCMD_ENDTRANSFER. Cc: [email protected] # v3.4 v3.5 v3.6 Reported-by: Moiz Sonasath <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
1 parent ddffeb8 commit 041d81f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/dwc3/gadget.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ static void dwc3_stop_active_transfer(struct dwc3 *dwc, u32 epnum)
19041904
ret = dwc3_send_gadget_ep_cmd(dwc, dep->number, cmd, &params);
19051905
WARN_ON_ONCE(ret);
19061906
dep->resource_index = 0;
1907-
1907+
dep->flags &= ~DWC3_EP_BUSY;
19081908
udelay(100);
19091909
}
19101910

0 commit comments

Comments
 (0)