Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c7ed808 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents dc87488b 44775a35
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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,