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

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

Merge "dwc3: gadget: Don't queue USB request if pull up is getting disable"

parents 2d6ae2bf e368d54e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -214,7 +214,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) {
	if (!dep->endpoint.desc || !dwc->pullups_connected) {
		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
				dep->name);
		ret = -ESHUTDOWN;
+7 −7
Original line number Diff line number Diff line
@@ -1453,7 +1453,7 @@ static int __dwc3_gadget_ep_queue(struct dwc3_ep *dep, struct dwc3_request *req)
	struct dwc3		*dwc = dep->dwc;
	int			ret = 0;

	if (!dep->endpoint.desc) {
	if (!dep->endpoint.desc || !dwc->pullups_connected) {
		dev_err(dwc->dev, "%s: can't queue to disabled endpoint\n",
				dep->name);
		return -ESHUTDOWN;
@@ -2112,6 +2112,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)
		dwc->pullups_connected = true;
	} else {
		dwc3_gadget_disable_irq(dwc);
		dwc->pullups_connected = false;
		__dwc3_gadget_ep_disable(dwc->eps[0]);
		__dwc3_gadget_ep_disable(dwc->eps[1]);

@@ -2127,8 +2128,6 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend)

		if (dwc->has_hibernation && !suspend)
			reg &= ~DWC3_DCTL_KEEP_CONNECT;

		dwc->pullups_connected = false;
	}

	dwc3_writel(dwc->regs, DWC3_DCTL, reg);
@@ -2898,11 +2897,12 @@ static void dwc3_endpoint_transfer_complete(struct dwc3 *dwc,
	}

	/*
	 * Our endpoint might get disabled by another thread during
	 * dwc3_gadget_giveback(). If that happens, we're just gonna return 1
	 * early on so DWC3_EP_BUSY flag gets cleared
	 * Our endpoint might get disabled by another thread or stop
	 * active transfer is invoked with pull up disable during
	 * dwc3_gadget_giveback(). If that happens, we're just gonna
	 * return 1 early on so DWC3_EP_BUSY flag gets cleared.
	 */
	if (!dep->endpoint.desc)
	if (!dep->endpoint.desc || !dwc->pullups_connected)
		return;

	if (!usb_endpoint_xfer_isoc(dep->endpoint.desc)) {