diff options
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/ntp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 65223b7ed810..af7563f5d4e2 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -34,7 +34,6 @@ int time_state = TIME_OK; /* clock synchronization status */ | |||
34 | int time_status = STA_UNSYNC; /* clock status bits */ | 34 | int time_status = STA_UNSYNC; /* clock status bits */ |
35 | long time_offset; /* time adjustment (ns) */ | 35 | long time_offset; /* time adjustment (ns) */ |
36 | long time_constant = 2; /* pll time constant */ | 36 | long time_constant = 2; /* pll time constant */ |
37 | long time_tolerance = MAXFREQ; /* frequency tolerance (ppm) */ | ||
38 | long time_precision = 1; /* clock precision (us) */ | 37 | long time_precision = 1; /* clock precision (us) */ |
39 | long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ | 38 | long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */ |
40 | long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ | 39 | long time_esterror = NTP_PHASE_LIMIT; /* estimated error (us) */ |
@@ -87,7 +86,7 @@ void second_overflow(void) | |||
87 | long time_adj; | 86 | long time_adj; |
88 | 87 | ||
89 | /* Bump the maxerror field */ | 88 | /* Bump the maxerror field */ |
90 | time_maxerror += time_tolerance >> SHIFT_USEC; | 89 | time_maxerror += MAXFREQ >> SHIFT_USEC; |
91 | if (time_maxerror > NTP_PHASE_LIMIT) { | 90 | if (time_maxerror > NTP_PHASE_LIMIT) { |
92 | time_maxerror = NTP_PHASE_LIMIT; | 91 | time_maxerror = NTP_PHASE_LIMIT; |
93 | time_status |= STA_UNSYNC; | 92 | time_status |= STA_UNSYNC; |
@@ -313,8 +312,8 @@ int do_adjtimex(struct timex *txc) | |||
313 | } else /* calibration interval too long (p. 12) */ | 312 | } else /* calibration interval too long (p. 12) */ |
314 | result = TIME_ERROR; | 313 | result = TIME_ERROR; |
315 | } | 314 | } |
316 | time_freq = min(time_freq, time_tolerance); | 315 | time_freq = min(time_freq, MAXFREQ); |
317 | time_freq = max(time_freq, -time_tolerance); | 316 | time_freq = max(time_freq, -MAXFREQ); |
318 | time_offset = (time_offset * NSEC_PER_USEC / HZ) << SHIFT_UPDATE; | 317 | time_offset = (time_offset * NSEC_PER_USEC / HZ) << SHIFT_UPDATE; |
319 | } /* STA_PLL */ | 318 | } /* STA_PLL */ |
320 | } /* txc->modes & ADJ_OFFSET */ | 319 | } /* txc->modes & ADJ_OFFSET */ |
@@ -337,7 +336,7 @@ leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0) | |||
337 | txc->status = time_status; | 336 | txc->status = time_status; |
338 | txc->constant = time_constant; | 337 | txc->constant = time_constant; |
339 | txc->precision = time_precision; | 338 | txc->precision = time_precision; |
340 | txc->tolerance = time_tolerance; | 339 | txc->tolerance = MAXFREQ; |
341 | txc->tick = tick_usec; | 340 | txc->tick = tick_usec; |
342 | 341 | ||
343 | /* PPS is not implemented, so these are zero */ | 342 | /* PPS is not implemented, so these are zero */ |