Commit 0227cc84 authored by Li Jun's avatar Li Jun Committed by Felipe Balbi

usb: dwc3: core: don't do suspend for device mode if already suspended

If dwc->dev in device mode already runtime suspended, don't do it again
for system suspend.
Signed-off-by: default avatarLi Jun <jun.li@nxp.com>
Signed-off-by: default avatarFelipe Balbi <balbi@kernel.org>
parent 4a1d042a
...@@ -1632,6 +1632,8 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg) ...@@ -1632,6 +1632,8 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
switch (dwc->current_dr_role) { switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_DEVICE: case DWC3_GCTL_PRTCAP_DEVICE:
if (pm_runtime_suspended(dwc->dev))
break;
spin_lock_irqsave(&dwc->lock, flags); spin_lock_irqsave(&dwc->lock, flags);
dwc3_gadget_suspend(dwc); dwc3_gadget_suspend(dwc);
spin_unlock_irqrestore(&dwc->lock, flags); spin_unlock_irqrestore(&dwc->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment