From owner-freebsd-acpi@FreeBSD.ORG Thu Mar 8 16:44:05 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 9F6C616A400 for ; Thu, 8 Mar 2007 16:44:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 48CEC13C4CE for ; Thu, 8 Mar 2007 16:44:05 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l28Gi2Co028698; Thu, 8 Mar 2007 11:44:02 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-acpi@freebsd.org Date: Thu, 8 Mar 2007 10:23:45 -0500 User-Agent: KMail/1.9.1 References: <200703011612.07110.shoesoft@gmx.net> <200703071053.45439.jhb@freebsd.org> <20070308183232.F3026@besplex.bde.org> In-Reply-To: <20070308183232.F3026@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200703081023.45976.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Thu, 08 Mar 2007 11:44:03 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2778/Thu Mar 8 11:20:58 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: 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: Thu, 08 Mar 2007 16:44:05 -0000 On Thursday 08 March 2007 02:32, Bruce Evans wrote: > On Wed, 7 Mar 2007, John Baldwin wrote: > > > On Wednesday 07 March 2007 00:14, Bruce Evans wrote: > >> I forgot to ask about the problem of interrupts racing with resume. > >> What stops an interrupt occurring before the resume methods (the device > >> method and all the ones above it) complete? I don't know of any locking > >> to prevent this or any way to detect this short of checking for magic > >> garbage in device registers that have garbage in them because the > >> registers are unmapped or just clobbered. Can suspend happen > >> asynchronously, so that it is possible for resume to deadlock on a > >> resource locked by somthing which was interrupted for the suspend? > > > > I don't think there is stuff in there to protect against locks being held. > > However, each device is supposed to turn its device off in it's > > device_suspend() method and then turn it back on in device_resume() which > > should resolve problems with garbage registers and spurious interrupts. > > pmtimer doesn't do this of course. Turning of RTC interrupts is easy, > but turning off i8254 interrupts seems to require bus_teardown_intr(). Since the clocks aren't a new-bus device anyway, we can make them explicitly be suspended and resumed while interrupts are disabled for x86. -- John Baldwin