1
0
Fork 0

MLK-23342-1 usb: dwc3: core: don't do suspend for device if suspended

If dwc->dev is already suspended in device mode, don't do it again.

Reviewed-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Li Jun 2020-02-18 16:14:10 +08:00
parent 5899aa781b
commit fa7f754967
1 changed files with 2 additions and 0 deletions

View File

@ -1697,6 +1697,8 @@ static int dwc3_suspend_common(struct dwc3 *dwc, pm_message_t msg)
switch (dwc->current_dr_role) {
case DWC3_GCTL_PRTCAP_DEVICE:
if (pm_runtime_suspended(dwc->dev))
break;
spin_lock_irqsave(&dwc->lock, flags);
dwc3_gadget_suspend(dwc);
spin_unlock_irqrestore(&dwc->lock, flags);