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

Commit c4774055 authored by Elson Roy Serrao's avatar Elson Roy Serrao
Browse files

usb: ep0: complete the pending control request before soft-disconnect



We abort the control request enqueue during a device initiated disconnect
as soon as the softconnect flag gets cleared. Whenever there is a race
between a control request and soft disconnect, the pending control
request is aborted before dwc3_gadget_pullup() function tries to
complete it. As a result the subsequent soft reconnect fails resulting
in usb connection loss. Avoid this by deciding the enqueue() operation
based on pullups_connected flag which gets cleared after completing the
pending request and putting the core in setup phase.

Change-Id: Ie21ecead7ed73569a426cd8bac586a5576c72993
Signed-off-by: default avatarElson Roy Serrao <eserrao@codeaurora.org>
parent 740a3c7b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ int dwc3_gadget_ep0_queue(struct usb_ep *ep, struct usb_request *request,
	u32				reg;

	spin_lock_irqsave(&dwc->lock, flags);
	if (!dep->endpoint.desc || !dwc->softconnect ||
	if (!dep->endpoint.desc || !dwc->pullups_connected ||
		!dwc->vbus_active) {
		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
				dep->name);