From 81a3e3bfb91858808bf347ee52900a75a465ecb6 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 24 Jan 2004 21:48:43 +0000 Subject: [PATCH] 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. --- sys/kern/kern_ntptime.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index 8bf109b8ba9e..af3b3f14b427 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