From e069300629d4cba26a2812c85f37ccaf0bd2e683 Mon Sep 17 00:00:00 2001 From: Robin Gong Date: Fri, 13 Apr 2018 19:35:12 +0800 Subject: [PATCH] MLK-18004: ARM: imx: pm-imx7ulp: fix resume failure in freeze mode This patch fix resume failure in freeze suspend mode on i.mx7ULP ("echo freeze > /sys/power/state") while pressing onoff key or enabling rtc alarm wakeup. In freeze mode, kernel can only be woken up by drivers which register wakup source such as 'device_init_wakeup' or 'irq_set_irq_wake', otherwise, kernel will wait for irq handler freeze_wake(). Unfortunately, our NMI interrupt which used to wakeup A7 by M4 is not a common device and request irq as 'IRQF_NO_SUSPEND' which means feeze_wake() never get chance to run while wakeup by any event from M4 such as RTC, ONOFF. In this case, use pm_system_wakeup() instead in NMI interrupt handle to trigger freeze_wake() directly. Signed-off-by: Robin Gong Reviewed-by: Anson Huang --- arch/arm/mach-imx/pm-imx7ulp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-imx/pm-imx7ulp.c b/arch/arm/mach-imx/pm-imx7ulp.c index 63fe0d4ed7f5..b4789a305742 100644 --- a/arch/arm/mach-imx/pm-imx7ulp.c +++ b/arch/arm/mach-imx/pm-imx7ulp.c @@ -788,6 +788,7 @@ static irqreturn_t imx7ulp_nmi_isr(int irq, void *param) { writel_relaxed(readl_relaxed(mu_base + MU_SR) | MU_B_SR_NMIC, mu_base + MU_SR); + pm_system_wakeup(); return IRQ_HANDLED; } -- 2.17.1