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.
This commit is contained in:
phk 2004-01-24 21:48:43 +00:00
parent bf28ee60e2
commit 81a3e3bfb9

View File

@ -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