Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jan 2006 05:19:03 -0800 (PST)
From:      "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>
To:        freebsd-emulation@freebsd.org
Subject:   [Patch] ports/rtc Timing will be inaccurate, please increase kern.hz
Message-ID:  <200601261319.FAA80592@gndrsh.dnsmgr.net>

next in thread | raw e-mail | index | archive | help
This is a long standing problem that has confused many users and
I could find at least 1 post in 2004 that stated the fix but didnt
provide a patch.

Users are confused by this diagnostic message more than they are
helped because it is printing the -current- value of HZ, not the
value requested.  This is caused by the order of things in the code,
we clober the sc->var.freq value because it is too large before
we print the diagnostic saying what value was too large....

Very simple fix, move the clober to be after the printf.

sysctl -a | grep hz
kern.clockrate: { hz = 200, tick = 5000, profhz = 1024, stathz = 128 }

Before PATCH:
rtc: 200 > kern.hz: Timing will be inaccurate, please increase kern.hz.
After PATCH:
rtc: 256 > kern.hz: Timing will be inaccurate, please increase kern.hz.

The request made by vmware was infact 256 in both cases.

--- files/rtc.c.orig	Tue Nov 29 07:43:43 2005
+++ files/rtc.c	Thu Jan 26 04:45:32 2006
@@ -269,8 +269,8 @@
 		}
 		sc->var.freq = freq;
 		if ((sc->var.freq > hz) && (hz < 1000)) {
-			sc->var.freq = hz;
 			printf("rtc: %d > kern.hz: Timing will be inaccurate, please increase kern.hz.\n", sc->var.freq);
+			sc->var.freq = hz;
 		}
 		sleep = hz / sc->var.freq;
 		DLog(Linfo, "Set RTC freq %d", sc->var.freq);


-- 
Rod Grimes                                                 freebsd@freebsd.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601261319.FAA80592>