aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time/ntp.c
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2013-03-22 18:04:13 -0400
committerJohn Stultz <john.stultz@linaro.org>2013-04-04 16:18:15 -0400
commitcef90377fab488bd1f959efda178fb83250cf61d (patch)
tree7ac4afc365ef3d35b339ac796d7ec921df618a58 /kernel/time/ntp.c
parent87ace39b7168bd9d352c1c52b6f5d88eb1876cf8 (diff)
timekeeping: Move ADJ_SETOFFSET to top level do_adjtimex()
Since ADJ_SETOFFSET adjusts the timekeeping state, process it as part of the top level do_adjtimex() function in timekeeping.c. This avoids deadlocks that could occur once we change the ntp locking rules. 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/ntp.c')
-rw-r--r--kernel/time/ntp.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index d17e13c0147d..a331ebc32e21 100644
--- a/kernel/time/ntp.c
+++ b/kernel/time/ntp.c
@@ -666,17 +666,6 @@ int __do_adjtimex(struct timex *txc, struct timespec *ts, s32 *time_tai)
666{ 666{
667 int result; 667 int result;
668 668
669 if (txc->modes & ADJ_SETOFFSET) {
670 struct timespec delta;
671 delta.tv_sec = txc->time.tv_sec;
672 delta.tv_nsec = txc->time.tv_usec;
673 if (!(txc->modes & ADJ_NANO))
674 delta.tv_nsec *= 1000;
675 result = timekeeping_inject_offset(&delta);
676 if (result)
677 return result;
678 }
679
680 raw_spin_lock_irq(&ntp_lock); 669 raw_spin_lock_irq(&ntp_lock);
681 670
682 if (txc->modes & ADJ_ADJTIME) { 671 if (txc->modes & ADJ_ADJTIME) {