Skip to content

Commit 684ad53

Browse files
Pavel TatashinKAGA-KOKO
authored andcommitted
timekeeping: Prevent false warning when persistent clock is not available
On arches with no persistent clock a message like this is printed during boot: [ 0.000000] Persistent clock returned invalid value The value is not invalid: Zero means that no persistent clock is available and the absence of persistent clock should be quietly accepted. Fixes: 3eca993 ("timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset()") Signed-off-by: Pavel Tatashin <pasha.tatashin@oracle.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: sboyd@kernel.org Cc: john.stultz@linaro.org Link: https://lkml.kernel.org/r/20180725200018.23722-1-pasha.tatashin@oracle.com
1 parent 9407f5a commit 684ad53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/time/timekeeping.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1536,7 +1536,7 @@ void __init timekeeping_init(void)
15361536
if (timespec64_valid_strict(&wall_time) &&
15371537
timespec64_to_ns(&wall_time) > 0) {
15381538
persistent_clock_exists = true;
1539-
} else {
1539+
} else if (timespec64_to_ns(&wall_time) != 0) {
15401540
pr_warn("Persistent clock returned invalid value");
15411541
wall_time = (struct timespec64){0};
15421542
}

0 commit comments

Comments
 (0)