summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXu Yang <xu.yang_2@nxp.com>2026-03-17 06:05:46 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-03-18 18:22:18 +0300
commit84db3719d27337b952fe382413d341fb95351130 (patch)
tree7142ba55faced598aae641c0165d13af942dd10e
parentd3d959404e6c72e09db8de8893a970edf0ac565d (diff)
downloadlinux-84db3719d27337b952fe382413d341fb95351130.tar.xz
usb: dwc3: imx: avoid calling imx suspend/resume callbacks twice
If a runtime suspend is executed followed by a system suspend, the driver may invoke dwc3_imx_suspend() twice, which causes enable_irq() to be called twice as well. This leads to an unbalanced IRQ state and may trigger warnings or malfunction. Prevent this by checking the pm_suspended flag before running the imx suspend/resume path. Fixes: 76fc9452a6bf ("usb: dwc3: introduce flatten model driver of i.MX Soc") Signed-off-by: Xu Yang <xu.yang_2@nxp.com> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://patch.msgid.link/20260317030546.1665206-1-xu.yang_2@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/dwc3/dwc3-imx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/dwc3-imx.c b/drivers/usb/dwc3/dwc3-imx.c
index 303708f7d79a..973a486b544d 100644
--- a/drivers/usb/dwc3/dwc3-imx.c
+++ b/drivers/usb/dwc3/dwc3-imx.c
@@ -288,6 +288,9 @@ static void dwc3_imx_remove(struct platform_device *pdev)
static void dwc3_imx_suspend(struct dwc3_imx *dwc_imx, pm_message_t msg)
{
+ if (dwc_imx->pm_suspended)
+ return;
+
if (PMSG_IS_AUTO(msg) || device_may_wakeup(dwc_imx->dev))
dwc3_imx_wakeup_enable(dwc_imx, msg);
@@ -299,6 +302,9 @@ static void dwc3_imx_resume(struct dwc3_imx *dwc_imx, pm_message_t msg)
{
struct dwc3 *dwc = &dwc_imx->dwc;
+ if (!dwc_imx->pm_suspended)
+ return;
+
dwc_imx->pm_suspended = false;
if (!dwc_imx->wakeup_pending)
disable_irq_nosync(dwc_imx->irq);