diff options
author | Wesley Cheng <[email protected]> | 2022-09-01 12:36:24 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2022-09-07 16:26:45 +0200 |
commit | b353eb6dc285a0775a447f53e5b2a50bf3f9684f (patch) | |
tree | 68d263136f87198ca5505604d5761ab3102d8d7c | |
parent | 461ee467507cb98a348fa91ff8460908bb0ea423 (diff) |
usb: dwc3: gadget: Skip waiting for CMDACT cleared during endxfer
For endxfer commands that do not require an endpoint complete interrupt,
avoid having to wait for the command active bit to clear. This allows for
EP0 events to continue to be handled, which allows for the controller to
complete it. Otherwise, it is known that the endxfer command will fail if
there is a pending SETUP token that needs to be read.
Suggested-by: Thinh Nguyen <[email protected]>
Reviewed-by: Thinh Nguyen <[email protected]>
Signed-off-by: Wesley Cheng <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/dwc3/gadget.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2faa3d4cb239..0149c9106752 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -366,7 +366,9 @@ int dwc3_send_gadget_ep_cmd(struct dwc3_ep *dep, unsigned int cmd, dwc3_writel(dep->regs, DWC3_DEPCMD, cmd); - if (!(cmd & DWC3_DEPCMD_CMDACT)) { + if (!(cmd & DWC3_DEPCMD_CMDACT) || + (DWC3_DEPCMD_CMD(cmd) == DWC3_DEPCMD_ENDTRANSFER && + !(cmd & DWC3_DEPCMD_CMDIOC))) { ret = 0; goto skip_status; } |