diff options
Diffstat (limited to 'kernel/time/ntp.c')
-rw-r--r-- | kernel/time/ntp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 580a35028693..fc08eb10ced4 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -142,7 +142,7 @@ static void ntp_update_offset(long offset) | |||
142 | * and in which mode (PLL or FLL). | 142 | * and in which mode (PLL or FLL). |
143 | */ | 143 | */ |
144 | secs = xtime.tv_sec - time_reftime; | 144 | secs = xtime.tv_sec - time_reftime; |
145 | if (unlikely(time_status & STA_FREQHOLD || time_reftime == 0)) | 145 | if (unlikely(time_status & STA_FREQHOLD)) |
146 | secs = 0; | 146 | secs = 0; |
147 | 147 | ||
148 | time_reftime = xtime.tv_sec; | 148 | time_reftime = xtime.tv_sec; |
@@ -394,6 +394,13 @@ int do_adjtimex(struct timex *txc) | |||
394 | } | 394 | } |
395 | /* only set allowed bits */ | 395 | /* only set allowed bits */ |
396 | time_status &= STA_RONLY; | 396 | time_status &= STA_RONLY; |
397 | /* | ||
398 | * If we turn on PLL adjustments then reset the | ||
399 | * reference time to current time. | ||
400 | */ | ||
401 | if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) | ||
402 | time_reftime = xtime.tv_sec; | ||
403 | |||
397 | time_status |= txc->status & ~STA_RONLY; | 404 | time_status |= txc->status & ~STA_RONLY; |
398 | 405 | ||
399 | switch (time_state) { | 406 | switch (time_state) { |