From owner-cvs-src@FreeBSD.ORG Sun Sep 26 18:19:33 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43D9916A4CE; Sun, 26 Sep 2004 18:19:33 +0000 (GMT) Received: from newtrinity.zeist.de (newtrinity.zeist.de [217.24.217.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9BC543D1D; Sun, 26 Sep 2004 18:19:32 +0000 (GMT) (envelope-from marius@newtrinity.zeist.de) Received: from newtrinity.zeist.de (localhost [127.0.0.1]) i8QIJQ1a070846; Sun, 26 Sep 2004 20:19:31 +0200 (CEST) (envelope-from marius@newtrinity.zeist.de) Received: (from marius@localhost) by newtrinity.zeist.de (8.12.10/8.12.10/Submit) id i8QIJLNd070845; Sun, 26 Sep 2004 20:19:21 +0200 (CEST) (envelope-from marius) Date: Sun, 26 Sep 2004 20:19:21 +0200 From: Marius Strobl To: John Baldwin Message-ID: <20040926201921.G69188@newtrinity.zeist.de> References: <200409192138.i8JLcBC7094537@repoman.freebsd.org> <200409201346.13358.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200409201346.13358.jhb@FreeBSD.org>; from jhb@FreeBSD.org on Mon, Sep 20, 2004 at 01:46:13PM -0400 X-AntiVirus: checked by AntiVir Milter 1.1-beta; AVE 6.27.0.12; VDF 6.27.0.72 (host: newtrinity.zeist.de) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/mk48txx mk48txx.c mk48txxreg.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Sep 2004 18:19:33 -0000 On Mon, Sep 20, 2004 at 01:46:13PM -0400, John Baldwin wrote: > On Sunday 19 September 2004 05:38 pm, Marius Strobl wrote: > > marius 2004-09-19 21:38:11 UTC > > > > - Fix two off-by-one errors in the handling of the day of week. The > > genclock code represents the dow as 0 - 6 with 0 being Sunday but the > > mk48txx use 1 - 7 with 1 being Sunday. In the settime function when > > writing the dow to the clock the range wasn't adjusted accordingly but > > the clock apparently played along nicely otherwise the second bug in > > the gettime function which mapped 1 - 7 to 0 - 6 but with 0 meaning > > Saturday would have been triggered. Fixing these makes the date being > > stored in the same format Sun/Solaris uses and cures the "Invalid time > > in real time clock. Check and reset the date immediately!" when the > > date was set under Solaris prior to booting FreeBSD/sparc64. [1] > > Looking at other clock drivers/code e.g. FreeBSD/alpha the former > > "bug", i.e. storing the dow as 0 - 6 even when the clock uses 1 - 7, seems > > to be common but might be on purpose for compatibility when multi-booting > > with other OS which do the same. So it might make sense to add a flag to > > handle the dow off-by-one for use of this driver on platforms other than > > sparc64. > > Hmm, I get them occasionally on my Alphas which only run FreeBSD, so I think > it's probably a bug that needs to be fixed in FreeBSD/alpha. > Bruce Evans pointed me at src/sys/i386/isa/clock.c revision 1.191 which fixed the same thing. According to its commit message the bug actually caused problems on Soekris machines. On my PWS which also only runs FreeBSD/alpha I ocassionally get "WARNING: clock gained X days -- CHECK AND RESET THE DATE!". This could be a problem similar to the one on Soekris boards when using the wrong encoding for the weekday but I haven't looked into it, yet. Do you also get "clock gained X days" warnings or something different? Do you have an idea when this happens? Marius