[tip:x86/timers] timekeeping: Warning when persistent clock is not available
From: tip-bot for Pavel Tatashin
Date: Mon Jul 30 2018 - 07:49:00 EST
Commit-ID: b8becb6ca494ddb84f5752ecdb6d56ae49d9ab8a
Gitweb: https://git.kernel.org/tip/b8becb6ca494ddb84f5752ecdb6d56ae49d9ab8a
Author: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>
AuthorDate: Wed, 25 Jul 2018 16:00:18 -0400
Committer: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
CommitDate: Mon, 30 Jul 2018 13:45:20 +0200
timekeeping: 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: it simply zero meaning no persistent clock and
the absence of persistent clock should be quietly accepted.
Fixes: 3eca993740b8 ("timekeeping: Replace read_boot_clock64() with read_persistent_wall_and_boot_offset()")
Signed-off-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>
Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: steven.sistare@xxxxxxxxxx
Cc: daniel.m.jordan@xxxxxxxxxx
Cc: sboyd@xxxxxxxxxx
Cc: john.stultz@xxxxxxxxxx
Link: https://lkml.kernel.org/r/20180725200018.23722-1-pasha.tatashin@xxxxxxxxxx
---
kernel/time/timekeeping.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 30d7f64ffc87..6183e7460138 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1536,7 +1536,7 @@ void __init timekeeping_init(void)
if (timespec64_valid_strict(&wall_time) &&
timespec64_to_ns(&wall_time) > 0) {
persistent_clock_exists = true;
- } else {
+ } else if (timespec64_to_ns(&wall_time) != 0) {
pr_warn("Persistent clock returned invalid value");
wall_time = (struct timespec64){0};
}