Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ec98e15 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by John Stultz
Browse files

timekeeping: Delay update of clock->cycle_last



For calculating the new timekeeper values store the new cycle_last
value in the timekeeper and update the clock->cycle_last just when we
actually update the new values.

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarJohn Stultz <john.stultz@linaro.org>
parent 14a3b6ab
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1271,7 +1271,7 @@ static cycle_t logarithmic_accumulation(struct timekeeper *tk, cycle_t offset,

	/* Accumulate one shifted interval */
	offset -= interval;
	tk->clock->cycle_last += interval;
	tk->cycle_last += interval;

	tk->xtime_nsec += tk->xtime_interval << shift;
	accumulate_nsecs_to_secs(tk);
@@ -1386,6 +1386,8 @@ static void update_wall_time(void)
	 */
	accumulate_nsecs_to_secs(tk);

	/* Update clock->cycle_last with the new value */
	clock->cycle_last = tk->cycle_last;
	timekeeping_update(tk, false);

out: