Skip to content

Commit

Permalink
hrtimer: Update base[CLOCK_BOOTTIME].offset correctly
Browse files Browse the repository at this point in the history
We calculate the current time of each clock base by adding an offset
to clock_monotonic. The offset for the clock bases is set in
retrigger_next_event() which is called when we switch a cpu to highres
mode or when the clock was set.

Add the missing update for clock boottime.

Signed-off-by: Thomas Gleixner <[email protected]>
Cc: John Stultz <[email protected]>
  • Loading branch information
KAGA-KOKO committed Mar 2, 2011
1 parent 7fdd7f8 commit 5cd10e7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ static void retrigger_next_event(void *arg)
raw_spin_lock(&base->lock);
base->clock_base[HRTIMER_BASE_REALTIME].offset =
timespec_to_ktime(realtime_offset);
base->clock_base[HRTIMER_BASE_BOOTTIME].offset =
timespec_to_ktime(sleep);

hrtimer_force_reprogram(base, 0);
raw_spin_unlock(&base->lock);
Expand Down

0 comments on commit 5cd10e7

Please sign in to comment.