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

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

Merge "usb: dwc3: Don't perform pm rt sync operations in atomic context"

parents 15d558c6 b2695767
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -951,6 +951,7 @@ static int dwc3_gadget_ep_disable(struct usb_ep *ep)
	struct dwc3			*dwc;
	unsigned long			flags;
	int				ret;
	bool				call_rpm_put = false;

	if (!ep) {
		pr_debug("dwc3: invalid parameters\n");
@@ -965,13 +966,18 @@ static int dwc3_gadget_ep_disable(struct usb_ep *ep)
					dep->name))
		return 0;

	if (atomic_read(&dwc->in_lpm)) {
		pm_runtime_get_sync(dwc->sysdev);
		call_rpm_put = true;
	}
	spin_lock_irqsave(&dwc->lock, flags);
	ret = __dwc3_gadget_ep_disable(dep);
	dbg_event(dep->number, "DISABLE", ret);
	spin_unlock_irqrestore(&dwc->lock, flags);
	if (call_rpm_put) {
		pm_runtime_mark_last_busy(dwc->sysdev);
		pm_runtime_put_autosuspend(dwc->sysdev);
	}

	return ret;
}