From owner-freebsd-current@FreeBSD.ORG Sat Mar 31 09:38:09 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BECB16A40B for ; Sat, 31 Mar 2007 09:38:09 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by mx1.freebsd.org (Postfix) with SMTP id DEEF213C4C4 for ; Sat, 31 Mar 2007 09:38:08 +0000 (UTC) (envelope-from shoesoft@gmx.net) Received: (qmail invoked by alias); 31 Mar 2007 09:38:07 -0000 Received: from h081217094222.dyn.cm.kabsi.at (EHLO taxman.pepperland) [81.217.94.222] by mail.gmx.net (mp004) with SMTP; 31 Mar 2007 11:38:07 +0200 X-Authenticated: #16703784 X-Provags-ID: V01U2FsdGVkX1/bBq46KofbkoGSNf2YS6L5kY1INkr67fE5AKf0Pa u5pZt2Rz+VG+74 From: Stefan Ehmann To: Bruce Evans Date: Sat, 31 Mar 2007 11:37:57 +0200 User-Agent: KMail/1.9.6 References: <200703011612.07110.shoesoft@gmx.net> <200703021619.33755.shoesoft@gmx.net> <20070304230346.O7298@besplex.bde.org> In-Reply-To: <20070304230346.O7298@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703311137.59128.shoesoft@gmx.net> X-Y-GMX-Trusted: 0 Cc: freebsd-current@freebsd.org Subject: Re: notebook freezes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Mar 2007 09:38:09 -0000 On Sunday 04 March 2007 13:27:48 Bruce Evans wrote: > On Fri, 2 Mar 2007, Stefan Ehmann wrote: > > On Thursday 01 March 2007 16:12, Stefan Ehmann wrote: > >> My few days old -current freezes if I press Fn-F6 (this is the > >> combination to adjust display brightness) if I've done a suspend/resume > >> before. Directly after boot it works fine. > > > > ... > > So I did a binary search. > > > > src/sys/i386/isa/clock.c r1.231 causes my notebook to freeze. > > > > Reverting this change in a CURRENT from today fixes the problem. > > > > The notebook is still pingable in this state. I experienced some other > > random hangs recently but don't know yet if those are related. > > Oops. If suspend/resume clobbers the RTC state (which we already have code > to restore), then it can clobber the RTC index (which even the restoral > code assumes is unclobbered). Try this fix. > > %%% > Index: clock.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/isa/clock.c,v > retrieving revision 1.234 > diff -u -2 -r1.234 clock.c > --- clock.c 4 Mar 2007 04:55:19 -0000 1.234 > +++ clock.c 4 Mar 2007 11:58:00 -0000 > @@ -580,4 +582,5 @@ > /* Restore all of the RTC's "status" (actually, control) registers. */ > /* XXX locking is needed for RTC access. */ > + rtc_reg = -1; > writertc(RTC_STATUSB, RTCSB_24HR); > writertc(RTC_STATUSA, rtc_statusa); > %%% For some odd reason, the problem has returned. I'm pretty sure that I've built a kernel shortly after your commit and it just worked fine. Now the problem persists when I build a kernel with sources from that date. I'm not aware of any big changes I made to my configuration. I checked that rtc_restore() gets called. Either I screwed up something last time or some changes in the userland expose a race (I only rebuilt kernel from older sources, not world). Backing out the changes made in 1.231 still fixes the problem. Stefan