soc: ti: pm33xx: Use cpu_idle_poll_ctrl in suspend path
authorDave Gerlach <d-gerlach@ti.com>
Fri, 2 Nov 2018 10:29:49 +0000 (15:59 +0530)
committerTero Kristo <t-kristo@ti.com>
Tue, 6 Nov 2018 13:25:30 +0000 (15:25 +0200)
Call cpu_idle_poll_ctrl at beginning and end of suspend path to avoid
races between cpuidle and suspend trying to communicate with the
wkup_m3, during suspend we only want it configured for entry to suspend.

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
drivers/soc/ti/pm33xx.c

index a1374aebf8cfb19ec61f6f079d649e76d977fa52..2c26e5ea252bb871c751abda1ee4ce3096ca012f 100644 (file)
@@ -261,6 +261,8 @@ static int am33xx_pm_begin(suspend_state_t state)
                rtc_only_idle = 0;
        }
 
+       cpu_idle_poll_ctrl(true);
+
        switch (state) {
        case PM_SUSPEND_MEM:
                ret = m3_ipc->ops->prepare_low_power(m3_ipc, WKUP_M3_DEEPSLEEP);
@@ -296,6 +298,8 @@ static void am33xx_pm_end(void)
        }
 
        rtc_only_idle = 0;
+
+       cpu_idle_poll_ctrl(false);
 }
 
 static int am33xx_pm_valid(suspend_state_t state)