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:
Poul-Henning Kamp 2004-01-24 21:48:43 +00:00
parent 81aecdd39d
commit 551260fc36
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124937

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