summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gong <yibin.gong@nxp.com>2021-08-06 00:19:06 +0800
committerPhilippe Schenker <philippe.schenker@toradex.com>2022-05-18 16:41:09 +0200
commitf04bac0476413576c8f5047c74325ecd7fd05b7a (patch)
treebf74b10227090f9818eea0d8b76913379ca2a16b
parenta96256e797c4c209df591137be67a656ef6b8533 (diff)
LF-4265: mailbox: imx: fix wakeup failure from freeze mode
Since IRQF_NO_SUSPEND used for imx mailbox driver, that means this irq can't be used for wakeup source so that can't wakeup from freeze mode. Add pm_system_wakeup() to wakeup from freeze mode. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit d12a9c6240167bab5a49180cf642cc9e6e518bca) (cherry picked from commit 23857411888f489fbff023d05a38a0cdc035af26)
-rw-r--r--drivers/mailbox/imx-mailbox.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mailbox/imx-mailbox.c b/drivers/mailbox/imx-mailbox.c
index df6a5930f79f..182df9ca24dc 100644
--- a/drivers/mailbox/imx-mailbox.c
+++ b/drivers/mailbox/imx-mailbox.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
+#include <linux/suspend.h>
#include <linux/slab.h>
#include <linux/jiffies.h>
@@ -67,6 +68,7 @@ struct imx_mu_priv {
const struct imx_mu_dcfg *dcfg;
struct clk *clk;
int irq;
+ bool suspend;
/* for control register save and restore */
u32 xcr;
@@ -374,6 +376,9 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
return IRQ_NONE;
}
+ if (priv->suspend)
+ pm_system_wakeup();
+
return IRQ_HANDLED;
}
@@ -634,7 +639,9 @@ static int imx_mu_suspend_noirq(struct device *dev)
if (!priv->clk)
priv->xcr = imx_mu_read(priv, priv->dcfg->xCR);
- return 0;
+ priv->suspend = true;
+
+ return 0;
}
static int imx_mu_resume_noirq(struct device *dev)
@@ -652,6 +659,8 @@ static int imx_mu_resume_noirq(struct device *dev)
if (!imx_mu_read(priv, priv->dcfg->xCR) && !priv->clk)
imx_mu_write(priv, priv->xcr, priv->dcfg->xCR);
+ priv->suspend = false;
+
return 0;
}