aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 54d90529f99d..e99350319eec 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1636,22 +1636,22 @@ ktime_t ktime_get_update_offsets_tick(ktime_t *offs_real, ktime_t *offs_boot,
1636 ktime_t *offs_tai) 1636 ktime_t *offs_tai)
1637{ 1637{
1638 struct timekeeper *tk = &tk_core.timekeeper; 1638 struct timekeeper *tk = &tk_core.timekeeper;
1639 struct timespec64 ts;
1640 ktime_t now;
1641 unsigned int seq; 1639 unsigned int seq;
1640 ktime_t base;
1641 u64 nsecs;
1642 1642
1643 do { 1643 do {
1644 seq = read_seqcount_begin(&tk_core.seq); 1644 seq = read_seqcount_begin(&tk_core.seq);
1645 1645
1646 ts = tk_xtime(tk); 1646 base = tk->base_mono;
1647 nsecs = tk->xtime_nsec >> tk->shift;
1648
1647 *offs_real = tk->offs_real; 1649 *offs_real = tk->offs_real;
1648 *offs_boot = tk->offs_boot; 1650 *offs_boot = tk->offs_boot;
1649 *offs_tai = tk->offs_tai; 1651 *offs_tai = tk->offs_tai;
1650 } while (read_seqcount_retry(&tk_core.seq, seq)); 1652 } while (read_seqcount_retry(&tk_core.seq, seq));
1651 1653
1652 now = ktime_set(ts.tv_sec, ts.tv_nsec); 1654 return ktime_add_ns(base, nsecs);
1653 now = ktime_sub(now, *offs_real);
1654 return now;
1655} 1655}
1656 1656
1657#ifdef CONFIG_HIGH_RES_TIMERS 1657#ifdef CONFIG_HIGH_RES_TIMERS