timekeeping: Make fast accessors return 0 before timekeeping is initialized
authorPrarit Bhargava <prarit@redhat.com>
Mon, 28 Aug 2017 12:21:53 +0000 (08:21 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 25 Sep 2017 19:05:59 +0000 (21:05 +0200)
commit5df32107f609c1f621bcdac0a685c23677ef671e
treeb2905082b3a3f8d0a2d6049e6b6175620e4d724f
parente19b205be43d11bff638cad4487008c48d21c103
timekeeping: Make fast accessors return 0 before timekeeping is initialized

printk timestamps will be extended to include mono and boot time by using
the fast timekeeping accessors ktime_get_mono|boot_fast_ns().  The
functions can return garbage before timekeeping is initialized resulting in
garbage timestamps.

Initialize the fast timekeepers with dummy clocks which guarantee a 0
readout up to timekeeping_init().

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: John Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/1503922914-10660-2-git-send-email-prarit@redhat.com
kernel/time/timekeeping.c