Skip to content

Commit

Permalink
mailbox: imx: fix wakeup failure from freeze mode
Browse files Browse the repository at this point in the history
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.

Fixes: b7b2796("mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag")
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
  • Loading branch information
Robin Gong authored and Jassi Brar committed Mar 13, 2022
1 parent af2dfa9 commit 892cb52
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/mailbox/imx-mailbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
#include <linux/suspend.h>
#include <linux/slab.h>

#define IMX_MU_CHANS 16
Expand Down Expand Up @@ -76,6 +77,7 @@ struct imx_mu_priv {
const struct imx_mu_dcfg *dcfg;
struct clk *clk;
int irq;
bool suspend;

u32 xcr[4];

Expand Down Expand Up @@ -334,6 +336,9 @@ static irqreturn_t imx_mu_isr(int irq, void *p)
return IRQ_NONE;
}

if (priv->suspend)
pm_system_wakeup();

return IRQ_HANDLED;
}

Expand Down Expand Up @@ -702,6 +707,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;

return 0;
}

Expand All @@ -723,6 +730,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;

return 0;
}

Expand Down

0 comments on commit 892cb52

Please sign in to comment.