aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/timekeeping.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2013-03-22 15:28:15 -0400
committerJohn Stultz <john.stultz@linaro.org>2013-04-04 16:18:15 -0400
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);
1618 */ 1618 */
1619int do_adjtimex(struct timex *txc) 1619int do_adjtimex(struct timex *txc)
1620{ 1620{
1621 struct timespec ts;
1622 s32 tai, orig_tai;
1621 int ret; 1623 int ret;
1622 1624
1623 /* Validate the data before disabling interrupts */ 1625 /* Validate the data before disabling interrupts */
@@ -1625,9 +1627,16 @@ int do_adjtimex(struct timex *txc)
1625 if (ret) 1627 if (ret)
1626 return ret; 1628 return ret;
1627 1629
1628 return __do_adjtimex(txc); 1630 getnstimeofday(&ts);
1629} 1631 orig_tai = tai = timekeeping_get_tai_offset();
1632
1633 ret = __do_adjtimex(txc, &ts, &tai);
1630 1634
1635 if (tai != orig_tai)
1636 timekeeping_set_tai_offset(tai);
1637
1638 return ret;
1639}
1631 1640
1632#ifdef CONFIG_NTP_PPS 1641#ifdef CONFIG_NTP_PPS
1633/** 1642/**