From c01833286b91b80caf56fd370ccc99060eb86a4a Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Tue, 25 Jun 2013 20:28:51 +0200 Subject: [PATCH] timesync: reduce the frequency tolerance from half to double the system clock the frequency tolerance used by timesync was from a 10th to 10 times the frequency of the system clock! switching a system from tsc to pic timer changes the system clock frequency from 300MHz to arround 1.8Ghz on a x200s laptop resulting in time running way too slow or way too fast. so we change timesync to only accept frequencies from half to double the system clock which still seems huge, but at least catches the case above resulting in timesync ignoring the old frequency file. --- sys/src/cmd/aux/timesync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/aux/timesync.c b/sys/src/cmd/aux/timesync.c index 11253efa9..e69281722 100644 --- a/sys/src/cmd/aux/timesync.c +++ b/sys/src/cmd/aux/timesync.c @@ -288,8 +288,8 @@ main(int argc, char **argv) /* figure out our time interface and initial frequency */ inittime(); gettime(0, 0, &hz); - minhz = hz/10; - maxhz = hz*10; + minhz = hz / 2; + maxhz = hz * 2; myprec = getclockprecision(hz); /* convert the accuracy from nanoseconds to ticks */