Skip to content

Commit 0a4114b

Browse files
johnstultz-workpopcornmix
authored andcommitted
timekeeping: Fix missing timekeeping_update in suspend path
commit 330a161 upstream. Since 48cdc13 (Implement a shadow timekeeper), we have to call timekeeping_update() after any adjustment to the timekeeping structure in order to make sure that any adjustments to the structure persist. In the timekeeping suspend path, we udpate the timekeeper structure, so we should be sure to update the shadow-timekeeper before releasing the timekeeping locks. Currently this isn't done. In most cases, the next time related code to run would be timekeeping_resume, which does update the shadow-timekeeper, but in an abundence of caution, this patch adds the call to timekeeping_update() in the suspend path. Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Prarit Bhargava <prarit@redhat.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 27ec615 commit 0a4114b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernel/time/timekeeping.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,8 @@ static int timekeeping_suspend(void)
10081008
timekeeping_suspend_time =
10091009
timespec_add(timekeeping_suspend_time, delta_delta);
10101010
}
1011+
1012+
timekeeping_update(tk, false, true);
10111013
write_seqcount_end(&timekeeper_seq);
10121014
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
10131015

0 commit comments

Comments
 (0)