Skip to content

Commit 93aca8a

Browse files
johnstultz-workgregkh
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 36050e2 commit 93aca8a

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
@@ -1024,6 +1024,8 @@ static int timekeeping_suspend(void)
10241024
timekeeping_suspend_time =
10251025
timespec_add(timekeeping_suspend_time, delta_delta);
10261026
}
1027+
1028+
timekeeping_update(tk, TK_MIRROR);
10271029
write_seqcount_end(&timekeeper_seq);
10281030
raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
10291031

0 commit comments

Comments
 (0)