Commit 892cb524 authored by Robin Gong's avatar Robin Gong Committed by Jassi Brar
Browse files

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.

Fixes: b7b2796b("mailbox: imx: ONLY IPC MU needs IRQF_NO_SUSPEND flag")
Reviewed-by: default avatarJacky Bai <ping.bai@nxp.com>
Reviewed-by: default avatarPeng Fan <peng.fan@nxp.com>
Signed-off-by: default avatarRobin Gong <yibin.gong@nxp.com>
Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent af2dfa96
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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
@@ -76,6 +77,7 @@ struct imx_mu_priv {
	const struct imx_mu_dcfg	*dcfg;
	struct clk		*clk;
	int			irq;
	bool			suspend;

	u32 xcr[4];

@@ -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;
}

@@ -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;
}

@@ -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;
}