summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_ntptime.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-01-24 21:48:43 +0000
committerphk <phk@FreeBSD.org>2004-01-24 21:48:43 +0000
commit81a3e3bfb91858808bf347ee52900a75a465ecb6 (patch)
tree6f6140686f976c008ae55c219b3b0e16e5d14b12 /sys/kern/kern_ntptime.c
parentbf28ee60e2da790032ff4ca6475fd95609f5fa3e (diff)
downloadFreeBSD-src-81a3e3bfb91858808bf347ee52900a75a465ecb6.zip
FreeBSD-src-81a3e3bfb91858808bf347ee52900a75a465ecb6.tar.gz
Deal with MOD_FREQUENCY before MOD_OFFSET because the latter is the
one which runs the actual update. This fixes a bug where there were a delay in applying the frequency adjustment. In extreme cases this could result in marginal stability of the kernel-pll.
Diffstat (limited to 'sys/kern/kern_ntptime.c')
-rw-r--r--sys/kern/kern_ntptime.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c
index 8bf109b..af3b3f1 100644
--- a/sys/kern/kern_ntptime.c
+++ b/sys/kern/kern_ntptime.c
@@ -351,12 +351,6 @@ ntp_adjtime(struct thread *td, struct ntp_adjtime_args *uap)
time_status |= STA_CLK;
if (modes & MOD_CLKA)
time_status &= ~STA_CLK;
- if (modes & MOD_OFFSET) {
- if (time_status & STA_NANO)
- hardupdate(ntv.offset);
- else
- hardupdate(ntv.offset * 1000);
- }
if (modes & MOD_FREQUENCY) {
freq = (ntv.freq * 1000LL) >> 16;
if (freq > MAXFREQ)
@@ -369,6 +363,12 @@ ntp_adjtime(struct thread *td, struct ntp_adjtime_args *uap)
pps_freq = time_freq;
#endif /* PPS_SYNC */
}
+ if (modes & MOD_OFFSET) {
+ if (time_status & STA_NANO)
+ hardupdate(ntv.offset);
+ else
+ hardupdate(ntv.offset * 1000);
+ }
/*
* Retrieve all clock variables. Note that the TAI offset is
OpenPOWER on IntegriCloud