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

Commit 336d33b9 authored by Udipto Goswami's avatar Udipto Goswami Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: Perform pm_runtime async op for suspend in ep_disable



The ep_disable functions uses pm_runtime_get_sync &
pm_runtime_put_sync_autosuspend to manage the dev & sysdev,
however doing auto suspend in sync context might lead to
errors on runtime framework due to the ASYNC flag not set.
When this happens, the runtime framework triggers
__might_sleep which in turn leads to a kernel panic.

Fix this by performing pm_runtime_put_autosuspend instead
of doing sync. This will set the ASYNC flag and will not go
for might_sleep check.

Change-Id: I9cff7738def5fac94d11e7648efc3602b9fe3ea6
Signed-off-by: default avatarUdipto Goswami <ugoswami@codeaurora.org>
Signed-off-by: default avatarRohith Kollalsi <rkollals@codeaurora.org>
parent c9a0e4a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -971,7 +971,7 @@ static int dwc3_gadget_ep_disable(struct usb_ep *ep)
	dbg_event(dep->number, "DISABLE", ret);
	spin_unlock_irqrestore(&dwc->lock, flags);
	pm_runtime_mark_last_busy(dwc->sysdev);
	pm_runtime_put_sync_autosuspend(dwc->sysdev);
	pm_runtime_put_autosuspend(dwc->sysdev);

	return ret;
}