Skip to content

Commit

Permalink
timekeeping: Make sure to notify hrtimers when TAI offset changes
Browse files Browse the repository at this point in the history
Now that we have CLOCK_TAI timers, make sure we notify hrtimer
code when TAI offset is changed.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Link: http://lkml.kernel.org/r/1365622909-953-1-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
John Stultz authored and Thomas Gleixner committed Apr 11, 2013
1 parent 51fd36f commit 4e8f8b3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -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 */
Expand All @@ -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);

Expand Down

0 comments on commit 4e8f8b3

Please sign in to comment.