diff options
author | Li Jun <jun.li@nxp.com> | 2020-02-20 00:20:04 +0800 |
---|---|---|
committer | Felipe Balbi <balbi@kernel.org> | 2020-03-15 11:31:36 +0200 |
commit | 0227cc84c44417a29c8102e41db8ec2c11ebc6b2 (patch) | |
tree | 5ea5b97eb5f1890236ad91becdb82cfa2b5f68f6 | |
parent | 4a1d042af4209544dba2196c2e92803907c3db88 (diff) |
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: Li Jun <jun.li@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
-rw-r--r-- | drivers/usb/dwc3/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index e6879a38b5a8..edc17155cb2b 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1632,6 +1632,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); |