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

Commit c86f3475 authored by Rohith Kollalsi's avatar Rohith Kollalsi Committed by Gerrit - the friendly Code Review server
Browse files

dwc3: gadget: Remove pm_runtime calls from dwc3_gadget_ep_disable



There is a chance that ep_disable will be called from mass
storage function driver after usb is in LPM as ep_disable
in mass storage function driver is called in worker
thread context. Hence, Commit 589a7f885ae2 ("usb: dwc3: Don't
perform pm rt sync operations in atomic context") added
pm_runtime calls for mass storage function driver,
so that system can be resumed and then do the ep_disable
operations.

But Commit e8e83c46c5eb ("usb: gadget: f_mass_storage: Disable
eps during disconnect") has changed the implementation of
ep_disable in mass storage function driver. It is now being
called in atomic context. So there is no chance of ep_disable
being called after usb is in lpm. Hence remove the support for
pm_runtime calls in ep_disable as they are any how no-op.

Change-Id: I5bcc2572da1608b24b1fe1cf14b6f1c3918d2d7a
Signed-off-by: default avatarRohith Kollalsi <quic_rkollals@quicinc.com>
parent e326bb59
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -966,7 +966,6 @@ 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");
@@ -981,18 +980,10 @@ 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;
}