Skip to contentSkip to conversation

mailbox: imx: Skip the suspend flag for i.MX7ULP

PATCH Applied Jacky Bai 3 participants 3 messages Dec 16, 2025 – Jan 18

Subsystems (2)
lore
Share & tools
lore

Jacky Bai

author
#0 lore raw

PATCH 1/1 mailbox: imx: Skip the suspend flag for i.MX7ULP

In current imx-mailbox driver, the MU IRQ is configured with 'IRQF_NO_SUSPEND' flag set. So during linux suspend/resume flow, the MU IRQ is always enabled. With commit 892cb524ae8a ("mailbox: imx:
fix wakeup failure from freeze mode"), if the MU IRQ is triggered after the priv->suspended flag has been set, the system suspend will be aborted.

On i.MX7ULP platform, certain drivers that depend on rpmsg may need to send rpmsg request and receive an acknowledgment from the remote core during the late_suspend stage. Early suspend abort is not expected, and the i.MX7ULP already has additional hardware and software to make sure the system can be wakeup from freeze mode correctly when MU IRQ is trigger.

Skip the 'suspend' flag handling logic on i.MX7ULP to avoid the early abort when doing suspend.

---
 drivers/mailbox/imx-mailbox.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/mailbox/imx-mailbox.c +6 -2
index 6778afc64a048c70a3afbdf44783ede0d1626937..003f9236c35e0943441b5e3cb01569451d7d0a96 100644
@@ -122,6 +122,7 @@ struct imx_mu_dcfg {
 	u32	xRR;		/* Receive Register0 */
 	u32	xSR[IMX_MU_xSR_MAX];	/* Status Registers */
 	u32	xCR[IMX_MU_xCR_MAX];	/* Control Registers */
+	bool	skip_suspend_flag;
 };
 
 #define IMX_MU_xSR_GIPn(type, x) (type & IMX_MU_V2 ? BIT(x) : BIT(28 + (3 - (x))))
@@ -988,6 +989,7 @@ static const struct imx_mu_dcfg imx_mu_cfg_imx7ulp = {
 	.xRR	= 0x40,
 	.xSR	= {0x60, 0x60, 0x60, 0x60},
 	.xCR	= {0x64, 0x64, 0x64, 0x64, 0x64},
+	.skip_suspend_flag = true,
 };
 
 static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
@@ -1071,7 +1073,8 @@ static int __maybe_unused imx_mu_suspend_noirq(struct device *dev)
 			priv->xcr[i] = imx_mu_read(priv, priv->dcfg->xCR[i]);
 	}
 
-	priv->suspend = true;
+	if (!priv->dcfg->skip_suspend_flag)
+		priv->suspend = true;
 
 	return 0;
 }
@@ -1094,7 +1097,8 @@ static int __maybe_unused imx_mu_resume_noirq(struct device *dev)
 			imx_mu_write(priv, priv->xcr[i], priv->dcfg->xCR[i]);
 	}
 
-	priv->suspend = false;
+	if (!priv->dcfg->skip_suspend_flag)
+		priv->suspend = false;
 
 	return 0;
 }

---
base-commit: 563c8dd425b59e44470e28519107b1efc99f4c7b
change-id: 20251216-imx7ulp_mailbox-9dd35bb9b94d

Best regards,

Signature · 1 line
Jacky Bai <[email protected]>
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines

Subject: [PATCH] mailbox: imx: Skip the suspend flag for i.MX7ULP

In current imx-mailbox driver, the MU IRQ is configured with 'IRQF_NO_SUSPEND' flag set. So during linux suspend/resume flow, the MU IRQ is always enabled. With commit 892cb524ae8a ("mailbox: imx:
fix wakeup failure from freeze mode"), if the MU IRQ is triggered after the priv->suspended flag has been set, the system suspend will be aborted.

On i.MX7ULP platform, certain drivers that depend on rpmsg may need to send rpmsg request and receive an acknowledgment from the remote core during the late_suspend stage. Early suspend abort is not expected, and the i.MX7ULP already has additional hardware and software to make sure the system can be wakeup from freeze mode correctly when MU IRQ is trigger.

Quoted 4 lines

Skip the 'suspend' flag handling logic on i.MX7ULP to avoid the early abort when doing suspend.

maintainer Applied
#2 lore raw
In reply to Jacky Bai
Quoted 68 lines · Jacky Bai

In current imx-mailbox driver, the MU IRQ is configured with 'IRQF_NO_SUSPEND' flag set. So during linux suspend/resume flow, the MU IRQ is always enabled. With commit 892cb524ae8a ("mailbox: imx:
fix wakeup failure from freeze mode"), if the MU IRQ is triggered after the priv->suspended flag has been set, the system suspend will be aborted.

On i.MX7ULP platform, certain drivers that depend on rpmsg may need to send rpmsg request and receive an acknowledgment from the remote core during the late_suspend stage. Early suspend abort is not expected, and the i.MX7ULP already has additional hardware and software to make sure the system can be wakeup from freeze mode correctly when MU IRQ is trigger.

Skip the 'suspend' flag handling logic on i.MX7ULP to avoid the early abort when doing suspend.

---
 drivers/mailbox/imx-mailbox.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/mailbox/imx-mailbox.c +6 -3
index 6778afc64a048c70a3afbdf44783ede0d1626937..003f9236c35e0943441b5e3cb01569451d7d0a96 100644
@@ -122,6 +122,7 @@ struct imx_mu_dcfg {
        u32     xRR;            /* Receive Register0 */
        u32     xSR[IMX_MU_xSR_MAX];    /* Status Registers */
        u32     xCR[IMX_MU_xCR_MAX];    /* Control Registers */
+       bool    skip_suspend_flag;
 };
 
 #define IMX_MU_xSR_GIPn(type, x) (type & IMX_MU_V2 ? BIT(x) : BIT(28 + (3 - (x))))
@@ -988,6 +989,7 @@ static const struct imx_mu_dcfg imx_mu_cfg_imx7ulp = {
        .xRR    = 0x40,
        .xSR    = {0x60, 0x60, 0x60, 0x60},
        .xCR    = {0x64, 0x64, 0x64, 0x64, 0x64},
+       .skip_suspend_flag = true,
 };
 
 static const struct imx_mu_dcfg imx_mu_cfg_imx8ulp = {
@@ -1071,7 +1073,8 @@ static int __maybe_unused imx_mu_suspend_noirq(struct device *dev)
                        priv->xcr[i] = imx_mu_read(priv, priv->dcfg->xCR[i]);
        }
 
-       priv->suspend = true;
+       if (!priv->dcfg->skip_suspend_flag)
+               priv->suspend = true;
 
        return 0;
 }
@@ -1094,7 +1097,8 @@ static int __maybe_unused imx_mu_resume_noirq(struct device *dev)
                        imx_mu_write(priv, priv->xcr[i], priv->dcfg->xCR[i]);
        }
 
-       priv->suspend = false;
+       if (!priv->dcfg->skip_suspend_flag)
+               priv->suspend = false;
 
        return 0;
 }
 
---

base-commit: 563c8dd425b59e44470e28519107b1efc99f4c7b
change-id: 20251216-imx7ulp_mailbox-9dd35bb9b94d

Quoted 4 lines

Best regards,
--
Jacky Bai <[email protected]>

Applied to mailbox/for-next.
Thanks.