Skip to content

Commit 673b570

Browse files
JackyBaiJassi Brar
authored andcommitted
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 892cb52 ("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. Signed-off-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent 6b0eadf commit 673b570

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/mailbox/imx-mailbox.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ struct imx_mu_dcfg {
122122
u32 xRR; /* Receive Register0 */
123123
u32 xSR[IMX_MU_xSR_MAX]; /* Status Registers */
124124
u32 xCR[IMX_MU_xCR_MAX]; /* Control Registers */
125+
bool skip_suspend_flag;
125126
};
126127

127128
#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 = {
988989
.xRR = 0x40,
989990
.xSR = {0x60, 0x60, 0x60, 0x60},
990991
.xCR = {0x64, 0x64, 0x64, 0x64, 0x64},
992+
.skip_suspend_flag = true,
991993
};
992994

993995
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)
10711073
priv->xcr[i] = imx_mu_read(priv, priv->dcfg->xCR[i]);
10721074
}
10731075

1074-
priv->suspend = true;
1076+
if (!priv->dcfg->skip_suspend_flag)
1077+
priv->suspend = true;
10751078

10761079
return 0;
10771080
}
@@ -1094,7 +1097,8 @@ static int __maybe_unused imx_mu_resume_noirq(struct device *dev)
10941097
imx_mu_write(priv, priv->xcr[i], priv->dcfg->xCR[i]);
10951098
}
10961099

1097-
priv->suspend = false;
1100+
if (!priv->dcfg->skip_suspend_flag)
1101+
priv->suspend = false;
10981102

10991103
return 0;
11001104
}

0 commit comments

Comments
 (0)