From 0227cc84c44417a29c8102e41db8ec2c11ebc6b2 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Thu, 20 Feb 2020 00:20:04 +0800 Subject: [PATCH] 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 Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 2 ++ 1 file changed, 2 insertions(+) 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);