]> Pileus Git - ~andy/linux/blobdiff - kernel/time/timekeeping.c
timekeeping: Make sure to notify hrtimers when TAI offset changes
[~andy/linux] / kernel / time / timekeeping.c
index c4d2a8751f3e0a2fa83e2c8285fe176ac07c46b8..675f720a848b62be66fbe6f7edaca2eb668061fe 100644 (file)
@@ -607,6 +607,7 @@ void timekeeping_set_tai_offset(s32 tai_offset)
        __timekeeping_set_tai_offset(tk, tai_offset);
        write_seqcount_end(&timekeeper_seq);
        raw_spin_unlock_irqrestore(&timekeeper_lock, flags);
+       clock_was_set();
 }
 
 /**
@@ -1639,7 +1640,7 @@ int do_adjtimex(struct timex *txc)
        struct timekeeper *tk = &timekeeper;
        unsigned long flags;
        struct timespec ts;
-       s32 tai;
+       s32 orig_tai, tai;
        int ret;
 
        /* Validate the data before disabling interrupts */
@@ -1663,10 +1664,13 @@ int do_adjtimex(struct timex *txc)
        raw_spin_lock_irqsave(&timekeeper_lock, flags);
        write_seqcount_begin(&timekeeper_seq);
 
-       tai = tk->tai_offset;
+       orig_tai = tai = tk->tai_offset;
        ret = __do_adjtimex(txc, &ts, &tai);
 
-       __timekeeping_set_tai_offset(tk, tai);
+       if (tai != orig_tai) {
+               __timekeeping_set_tai_offset(tk, tai);
+               clock_was_set_delayed();
+       }
        write_seqcount_end(&timekeeper_seq);
        raw_spin_unlock_irqrestore(&timekeeper_lock, flags);