summaryrefslogtreecommitdiff
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2019-06-22 13:07:35 +0300
committerThomas Gleixner <tglx@linutronix.de>2019-06-22 13:07:35 +0300
commit6808acb57a286cda48d8674713e672681ca7ffb3 (patch)
tree77ca408d2453069f6caec40053c4a20e60594c32 /kernel/time/timekeeping.c
parentd21e43f2ef32ba3242687dbedb3c4b9a76b3eebc (diff)
parent9e0babf2c06c73cda2c0cd37a1653d823adb40ec (diff)
downloadlinux-6808acb57a286cda48d8674713e672681ca7ffb3.tar.xz
Merge branch 'linus' into timers/core
Pick up upstream fixes for pending changes.
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 85f5912d8f70..44b726bab4bd 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -808,17 +808,18 @@ ktime_t ktime_get_coarse_with_offset(enum tk_offsets offs)
struct timekeeper *tk = &tk_core.timekeeper;
unsigned int seq;
ktime_t base, *offset = offsets[offs];
+ u64 nsecs;
WARN_ON(timekeeping_suspended);
do {
seq = read_seqcount_begin(&tk_core.seq);
base = ktime_add(tk->tkr_mono.base, *offset);
+ nsecs = tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift;
} while (read_seqcount_retry(&tk_core.seq, seq));
- return base;
-
+ return base + nsecs;
}
EXPORT_SYMBOL_GPL(ktime_get_coarse_with_offset);