From owner-freebsd-acpi@FreeBSD.ORG Sun Mar 4 20:20:25 2007 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C095016A400 for ; Sun, 4 Mar 2007 20:20:25 +0000 (UTC) (envelope-from nate@root.org) Received: from root.org (root.org [67.118.192.226]) by mx1.freebsd.org (Postfix) with ESMTP id A4E1A13C49D for ; Sun, 4 Mar 2007 20:20:25 +0000 (UTC) (envelope-from nate@root.org) Received: (qmail 47632 invoked from network); 4 Mar 2007 20:13:59 -0000 Received: from ppp-71-139-18-69.dsl.snfc21.pacbell.net (HELO ?10.0.5.55?) (nate-mail@71.139.18.69) by root.org with ESMTPA; 4 Mar 2007 20:13:59 -0000 Message-ID: <45EB28A1.5010803@root.org> Date: Sun, 04 Mar 2007 12:14:25 -0800 From: Nate Lawson User-Agent: Thunderbird 1.5.0.9 (X11/20070214) MIME-Version: 1.0 To: Bruce Evans References: <200703011612.07110.shoesoft@gmx.net> <200703021619.33755.shoesoft@gmx.net> <20070304230346.O7298@besplex.bde.org> <200703041359.52213.shoesoft@gmx.net> <20070305004000.B17935@delplex.bde.org> In-Reply-To: <20070305004000.B17935@delplex.bde.org> X-Enigmail-Version: 0.94.2.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org, Stefan Ehmann Subject: Re: notebook freezes X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2007 20:20:25 -0000 Bruce Evans wrote: > [Trying to redirect this from current to acpi.] > > On Sun, 4 Mar 2007, Stefan Ehmann wrote: > >> On Sunday 04 March 2007 13:27, 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); >>> %%% >>> >>> A similar fix might be needed for amd64, but amd64 doesn't have a resume >>> hook for putting it in. The RTC index might get clobbered even if the >>> data registers aren't. >>> >>> I don't know how any of this works with ACPI. AFAIK (not far), the >>> resume >>> hook is only called for APM. >> >> Yes, rtc_restore() doesn't get called. So the patch changes nothing >> for me. Bruce's patch should work if you add "device pmtimer" to your kernel config. That will allow pmtimer_resume() to call timer_restore() which calls rtc_restore(). If that works for you, Bruce can commit it modulo style bugs. ;-) -- Nate