From owner-cvs-all@FreeBSD.ORG Sat May 1 16:49:07 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3204816A4CE for ; Sat, 1 May 2004 16:49:07 -0700 (PDT) Received: from relay.pair.com (relay.pair.com [209.68.1.20]) by mx1.FreeBSD.org (Postfix) with SMTP id 722DD43D3F for ; Sat, 1 May 2004 16:49:06 -0700 (PDT) (envelope-from silby@silby.com) Received: (qmail 90360 invoked from network); 1 May 2004 23:49:05 -0000 Received: from niwun.pair.com (HELO localhost) (209.68.2.70) by relay.pair.com with SMTP; 1 May 2004 23:49:05 -0000 X-pair-Authenticated: 209.68.2.70 Date: Sat, 1 May 2004 18:48:54 -0500 (CDT) From: Mike Silbersack To: Bruce Evans In-Reply-To: <20040501214146.N20783@gamplex.bde.org> Message-ID: <20040501184603.I1080@odysseus.silby.com> References: <200404272003.i3RK3RFZ048001@repoman.freebsd.org> <20040430221434.J749@odysseus.silby.com> <20040501044209.L704@odysseus.silby.com> <20040501214146.N20783@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/isa clock.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2004 23:49:07 -0000 On Sat, 1 May 2004, Bruce Evans wrote: > On Sat, 1 May 2004, Mike Silbersack wrote: > > > delta += timer0_max_count; > > I think you missed that the hardware timer is count-down. We don't assume > anything about entire counter cycles; we just miss them and wait another > timer0_max_count cycles. The adjustment by timer0_max count is just to > to convert the counter from count-down to count-up. it works right for > that: Gah, yeah, I wasn't awake enough when I was reading the code last night. I had been reading that line as "delta = timer0_max_count", rather than +=. The code makes sense to me now. > HZ=1000 instead of the default of HZ=10 increases the chance of the > timer wrapping while DELAY() is interrupted. This shouldn't be a > problem for TSC calibration. Apparently it is a problem, somehow. :) I am using HZ=1000 on the trouble system, FWIW. > My version of TSC calibration uses a much more precise algorithm. It > still uses the i8254 since this is the best clock to compare with > for technical reasons. I will send this in private mail. You could > also try RELENG_4 to get calibration of the TSC relative to the RTC. > This is more precise than the current calibration, but may be less > accurate since the nominal RTC frequency may be less accurate than > the nominal i8254 frequency. > > Bruce I tried the first patch and it didn't help, I may give the second patch a go after I finish up some (non-freebsd) work. Mike "Silby" Silbersack