MLK-18004: ARM: imx: pm-imx7ulp: fix resume failure in freeze mode
authorRobin Gong <yibin.gong@nxp.com>
Fri, 13 Apr 2018 11:35:12 +0000 (19:35 +0800)
committerRobin Gong <yibin.gong@nxp.com>
Fri, 13 Apr 2018 13:31:20 +0000 (21:31 +0800)
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 <yibin.gong@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
arch/arm/mach-imx/pm-imx7ulp.c

index 63fe0d4..b4789a3 100644 (file)
@@ -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;
 }