diff options
author | Anson Huang <Anson.Huang@nxp.com> | 2020-05-09 11:04:58 +0800 |
---|---|---|
committer | Anson Huang <Anson.Huang@nxp.com> | 2020-05-09 12:50:38 +0800 |
commit | 2aca1aa4a1171b2447a85a54222765320b73e7ff (patch) | |
tree | c87a05488d866f4c96fe7ee2571ee142f77a8951 /drivers/mailbox/imx-mailbox.c | |
parent | 1a5fc3f3a49551f721222e0147324fd0dc741d34 (diff) |
MLK-23952 mailbox: imx: ONLY save/restore MU context for SCU platforms
On i.MX8MP, the MU clock is combined with power domain and runtime
PM is enabled, during noirq suspend/resume phase, runtime PM is
disabled by device suspend, calling clock prepare will trigger
runtime resume failure and lead to system suspend failed.
There is no good way to handle such MU clocks combined with runtime
PM in noirq suspend phase, actually, the MU context save/restore is
ONLY necessary for SCU IPC MU, other MUs especially on i.MX8MP platforms
which have clocks assigned, they need to runtime request/free mailbox
channel in the consumer driver, so no need to save/restore MU context
for them, hence it can avoid this issue.
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Diffstat (limited to 'drivers/mailbox/imx-mailbox.c')
-rw-r--r-- | drivers/mailbox/imx-mailbox.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c index b2c8ea813d48..34de09a023a3 100644 --- a/drivers/mailbox/imx-mailbox.c +++ b/drivers/mailbox/imx-mailbox.c @@ -628,16 +628,9 @@ static int imx_mu_remove(struct platform_device *pdev) static int imx_mu_suspend_noirq(struct device *dev) { struct imx_mu_priv *priv = dev_get_drvdata(dev); - int ret; - - ret = clk_prepare_enable(priv->clk); - if (ret) { - dev_err(dev, "failed to enable clock\n"); - return ret; - } - priv->xcr = imx_mu_read(priv, priv->dcfg->xCR); - clk_disable_unprepare(priv->clk); + if (!priv->clk) + priv->xcr = imx_mu_read(priv, priv->dcfg->xCR); return 0; } @@ -645,13 +638,6 @@ static int imx_mu_suspend_noirq(struct device *dev) static int imx_mu_resume_noirq(struct device *dev) { struct imx_mu_priv *priv = dev_get_drvdata(dev); - int ret; - - ret = clk_prepare_enable(priv->clk); - if (ret) { - dev_err(dev, "failed to enable clock\n"); - return ret; - } /* * ONLY restore MU when context lost, the TIE could @@ -661,9 +647,8 @@ static int imx_mu_resume_noirq(struct device *dev) * send failed, may lead to system freeze. This issue * is observed by testing freeze mode suspend. */ - if (!imx_mu_read(priv, priv->dcfg->xCR)) + if (!imx_mu_read(priv, priv->dcfg->xCR) && !priv->clk) imx_mu_write(priv, priv->xcr, priv->dcfg->xCR); - clk_disable_unprepare(priv->clk); return 0; } |