From 95725d4dc6b801b7a4cc847b3e810cd059831e7f Mon Sep 17 00:00:00 2001 From: Mahesh Sivasubramanian Date: Wed, 20 Apr 2016 14:58:45 -0600 Subject: [PATCH] drivers: cpuidle: lpm-levels: Fix wakeup time for suspend During suspend, where there isn't a explicit timer requirement, suspend driver adds a ~0ULL value to current timer value and passes it on to RPM as the wakeup timer. However, RPM doesn't handle overflow of timer wakeups, which could indicate that the master is requesting a wakeup in the past and causes a crash. Adding 1 to current wakeup times, sets the wakeup time to 0 for suspend usecases. MPM maps a 0 wakeup time to ~0ULL which would be handled correctly on the RPM side. Change-Id: Ida24c83eb2f1ae94ad7168b6065db69da35c3ec9 Signed-off-by: Mahesh Sivasubramanian Signed-off-by: Girish S Ghongdemath --- drivers/cpuidle/lpm-levels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpuidle/lpm-levels.c b/drivers/cpuidle/lpm-levels.c index 2b0df3f0e04e..4f880fdd1478 100644 --- a/drivers/cpuidle/lpm-levels.c +++ b/drivers/cpuidle/lpm-levels.c @@ -674,6 +674,7 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx, goto failed_set_mode; } + us = us + 1; do_div(us, USEC_PER_SEC/SCLK_HZ); msm_mpm_enter_sleep(us, from_idle, cpumask); }