[PATCH] GTOD: persistent clock support
[powerpc.git] / kernel / hrtimer.c
index f44e499..c0fdb9b 100644 (file)
@@ -128,15 +128,20 @@ EXPORT_SYMBOL_GPL(ktime_get_ts);
 static void hrtimer_get_softirq_time(struct hrtimer_base *base)
 {
        ktime_t xtim, tomono;
+       struct timespec xts;
        unsigned long seq;
 
        do {
                seq = read_seqbegin(&xtime_lock);
-               xtim = timespec_to_ktime(xtime);
-               tomono = timespec_to_ktime(wall_to_monotonic);
-
+#ifdef CONFIG_NO_HZ
+               getnstimeofday(&xts);
+#else
+               xts = xtime;
+#endif
        } while (read_seqretry(&xtime_lock, seq));
 
+       xtim = timespec_to_ktime(xts);
+       tomono = timespec_to_ktime(wall_to_monotonic);
        base[CLOCK_REALTIME].softirq_time = xtim;
        base[CLOCK_MONOTONIC].softirq_time = ktime_add(xtim, tomono);
 }
@@ -286,6 +291,14 @@ static unsigned long ktime_divns(const ktime_t kt, s64 div)
 # define ktime_divns(kt, div)          (unsigned long)((kt).tv64 / (div))
 #endif /* BITS_PER_LONG >= 64 */
 
+/*
+ * Timekeeping resumed notification
+ */
+void hrtimer_notify_resume(void)
+{
+       clock_was_set();
+}
+
 /*
  * Counterpart to lock_timer_base above:
  */