Skip to content

Commit

Permalink
mailbox: imx: fix wakeup failure from freeze mode
Browse files Browse the repository at this point in the history
commit 892cb52 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Robin Gong authored and gregkh committed Apr 8, 2022
1 parent 051360e commit a16f5ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/mailbox/imx-mailbox.c
Expand Up @@ -13,6 +13,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_xSR_GIPn(x) BIT(28 + (3 - (x)))
Expand Down Expand Up @@ -66,6 +67,7 @@ struct imx_mu_priv {
const struct imx_mu_dcfg *dcfg;
struct clk *clk;
int irq;
bool suspend;

u32 xcr;

Expand Down Expand Up @@ -277,6 +279,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 @@ -326,6 +331,8 @@ static int imx_mu_startup(struct mbox_chan *chan)
break;
}

priv->suspend = true;

return 0;
}

Expand Down Expand Up @@ -543,6 +550,8 @@ static int imx_mu_probe(struct platform_device *pdev)

clk_disable_unprepare(priv->clk);

priv->suspend = false;

return 0;

disable_runtime_pm:
Expand Down

0 comments on commit a16f5ae

Please sign in to comment.