Merge "drivers: cpuidle: Minimize round off errors in wake up time"
This commit is contained in:
commit
f9aee28de6
1 changed files with 13 additions and 2 deletions
|
@ -1123,6 +1123,8 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
|
||||||
struct cpumask nextcpu, *cpumask;
|
struct cpumask nextcpu, *cpumask;
|
||||||
uint64_t us;
|
uint64_t us;
|
||||||
uint32_t pred_us;
|
uint32_t pred_us;
|
||||||
|
uint64_t sec;
|
||||||
|
uint64_t nsec;
|
||||||
|
|
||||||
us = get_cluster_sleep_time(cluster, &nextcpu,
|
us = get_cluster_sleep_time(cluster, &nextcpu,
|
||||||
from_idle, &pred_us);
|
from_idle, &pred_us);
|
||||||
|
@ -1134,11 +1136,20 @@ static int cluster_configure(struct lpm_cluster *cluster, int idx,
|
||||||
goto failed_set_mode;
|
goto failed_set_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
us = (us + 1) * 1000;
|
|
||||||
clear_predict_history();
|
clear_predict_history();
|
||||||
clear_cl_predict_history();
|
clear_cl_predict_history();
|
||||||
|
|
||||||
do_div(us, NSEC_PER_SEC/SCLK_HZ);
|
us = us + 1;
|
||||||
|
sec = us;
|
||||||
|
do_div(sec, USEC_PER_SEC);
|
||||||
|
nsec = us - sec * USEC_PER_SEC;
|
||||||
|
|
||||||
|
sec = sec * SCLK_HZ;
|
||||||
|
if (nsec > 0) {
|
||||||
|
nsec = nsec * NSEC_PER_USEC;
|
||||||
|
do_div(nsec, NSEC_PER_SEC/SCLK_HZ);
|
||||||
|
}
|
||||||
|
us = sec + nsec;
|
||||||
msm_mpm_enter_sleep(us, from_idle, cpumask);
|
msm_mpm_enter_sleep(us, from_idle, cpumask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue