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

Commit 383e9017 authored by Hemant Kumar's avatar Hemant Kumar
Browse files

dwc3: gadget: Initiate remote wakeup only if configuration allows



Gadget driver initiates remote wakeup after bus suspend even if
current configuration of device does not support it. As a result
functions like diag queue the request at bus suspend during
disconnect. This causes page fault exception while traversing
config->functions list in composite_resume() when unbind_config()
is racing with it as part of disconnect. Hence check remote_wakeup
flag before initiating the remote wakeup after bus suspend.
remote_wakeup flag is set to true when host issues set
feature remote wakeup before doing bus suspend in case of high,
full, low speed.

CRs-Fixed: 755939
Change-Id: Ic26a1542896667b36e14fc65c6d3646953672197
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 2a4b1904
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1485,9 +1485,10 @@ static int dwc3_gadget_ep_queue(struct usb_ep *ep, struct usb_request *request,
	}

	if (dwc3_gadget_is_suspended(dwc)) {
		if (dwc->gadget.remote_wakeup)
			dwc3_gadget_wakeup(&dwc->gadget);
		spin_unlock_irqrestore(&dwc->lock, flags);
		return -EAGAIN;
		return dwc->gadget.remote_wakeup ? -EAGAIN : -ENOTSUPP;
	}

	dev_vdbg(dwc->dev, "queing request %p to %s length %d\n",