-
- Downloads
sched_clock: Avoid corrupting hrtimer tree during suspend
During suspend we call sched_clock_poll() to update the epoch and accumulated time and reprogram the sched_clock_timer to fire before the next wrap-around time. Unfortunately, sched_clock_poll() doesn't restart the timer, instead it relies on the hrtimer layer to do that and during suspend we aren't calling that function from the hrtimer layer. Instead, we're reprogramming the expires time while the hrtimer is enqueued, which can cause the hrtimer tree to be corrupted. Furthermore, we restart the timer during suspend but we update the epoch during resume which seems counter-intuitive. Let's fix this by saving the accumulated state and canceling the timer during suspend. On resume we can update the epoch and restart the timer similar to what we would do if we were starting the clock for the first time. Change-Id: Iee2a1cca42e5b681347ea0607e9af420a63892d7 CRs-Fixed: 696826 Fixes: a08ca5d1 "sched_clock: Use an hrtimer instead of timer" Signed-off-by:Stephen Boyd <sboyd@codeaurora.org>
Loading
Please register or sign in to comment