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:
parent
bf28ee60e2
commit
81a3e3bfb9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user