mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
Merge "usb: dwc3: Don't perform pm rt sync operations in atomic context"
This commit is contained in:
commit
adc03f0e9a
1 changed files with 9 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
pm_runtime_get_sync(dwc->sysdev);
|
||||
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);
|
||||
pm_runtime_mark_last_busy(dwc->sysdev);
|
||||
pm_runtime_put_autosuspend(dwc->sysdev);
|
||||
if (call_rpm_put) {
|
||||
pm_runtime_mark_last_busy(dwc->sysdev);
|
||||
pm_runtime_put_autosuspend(dwc->sysdev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue