Merge "usb: dwc3: gadget: delay clearing run/stop when setup just arrived"

This commit is contained in:
qctecmdr 2019-10-28 11:47:22 -07:00 • committed by Gerrit - the friendly Code Review server
commit 3c7ed8087d

View file

@ -2055,7 +2055,8 @@ static int dwc3_gadget_pullup(struct usb_gadget *g, int is_on)
* Per databook, when we want to stop the gadget, if a control transfer
* is still in process, complete it and get the core into setup phase.
*/
if (!is_on && dwc->ep0state != EP0_SETUP_PHASE) {
if (!is_on && (dwc->ep0state != EP0_SETUP_PHASE ||
dwc->ep0_next_event != DWC3_EP0_COMPLETE)) {
reinit_completion(&dwc->ep0_in_setup);
ret = wait_for_completion_timeout(&dwc->ep0_in_setup,