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

Commit c10612cb authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: ci13xxx: Bail out from ep fifo_flush if USB in LPM"

parents 0e217cb6 be7605c7
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -1683,7 +1683,8 @@ static int ci13xxx_wakeup(struct usb_gadget *_gadget)
	}
	hw_cwrite(CAP_PORTSC, PORTSC_FPR, PORTSC_FPR);

	pm_runtime_put(&_gadget->dev);
	pm_runtime_mark_last_busy(&_gadget->dev);
	pm_runtime_put_autosuspend(&_gadget->dev);
out:
	spin_unlock_irqrestore(udc->lock, flags);
	return ret;
@@ -3369,6 +3370,7 @@ static int ep_set_wedge(struct usb_ep *ep)
 */
static void ep_fifo_flush(struct usb_ep *ep)
{
	struct ci13xxx *udc = _udc;
	struct ci13xxx_ep *mEp = container_of(ep, struct ci13xxx_ep, ep);
	unsigned long flags;

@@ -3379,6 +3381,13 @@ static void ep_fifo_flush(struct usb_ep *ep)
		return;
	}

	if (udc->udc_driver->in_lpm && udc->udc_driver->in_lpm(udc)) {
		dev_err(udc->transceiver->dev,
				"%s: Unable to fifo_flush while in LPM\n",
				__func__);
		return;
	}

	spin_lock_irqsave(mEp->lock, flags);

	dbg_event(_usb_addr(mEp), "FFLUSH", 0);
@@ -3504,7 +3513,8 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, int is_active)
	}
	spin_unlock_irqrestore(udc->lock, flags);

	pm_runtime_put_sync(&_gadget->dev);
	pm_runtime_mark_last_busy(&_gadget->dev);
	pm_runtime_put_autosuspend(&_gadget->dev);

	return 0;
}
@@ -3899,6 +3909,10 @@ static int udc_probe(struct ci13xxx_udc_driver *driver, struct device *dev,
	pm_runtime_set_active(&udc->gadget.dev);
	pm_runtime_enable(&udc->gadget.dev);

	/* Use delayed LPM especially for composition-switch in LPM (suspend) */
	pm_runtime_set_autosuspend_delay(&udc->gadget.dev, 2000);
	pm_runtime_use_autosuspend(&udc->gadget.dev);

	_udc = udc;
	return retval;