summaryrefslogtreecommitdiff
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2013-03-22 12:28:15 -0700
committerJohn Stultz <john.stultz@linaro.org>2013-04-04 13:18:15 -0700
commit87ace39b7168bd9d352c1c52b6f5d88eb1876cf8 (patch)
tree57f19306b0f2e9b99430f92a4ba9a7ac9454e2e0 /kernel/time/timekeeping.c
parente4085693f629ded8ac8c35b5cdd324d20242990b (diff)
ntp: Rework do_adjtimex to take timespec and tai arguments
In order to change the locking rules, we need to provide the timespec and tai values rather then having the ntp logic acquire these values itself. Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/timekeeping.c')
-rw-r--r--kernel/time/timekeeping.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index f6c8a7279157..5f7a2330dc3c 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -1618,6 +1618,8 @@ EXPORT_SYMBOL_GPL(ktime_get_monotonic_offset);
*/
int do_adjtimex(struct timex *txc)
{
+ struct timespec ts;
+ s32 tai, orig_tai;
int ret;
/* Validate the data before disabling interrupts */
@@ -1625,9 +1627,16 @@ int do_adjtimex(struct timex *txc)
if (ret)
return ret;
- return __do_adjtimex(txc);
-}
+ getnstimeofday(&ts);
+ orig_tai = tai = timekeeping_get_tai_offset();
+
+ ret = __do_adjtimex(txc, &ts, &tai);
+ if (tai != orig_tai)
+ timekeeping_set_tai_offset(tai);
+
+ return ret;
+}
#ifdef CONFIG_NTP_PPS
/**