From owner-cvs-all@FreeBSD.ORG Wed Nov 14 17:15:42 2007 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3654516A417; Wed, 14 Nov 2007 17:15:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id F1D7A13C4BB; Wed, 14 Nov 2007 17:15:39 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8p) with ESMTP id 219281686-1834499 for multiple; Wed, 14 Nov 2007 12:16:18 -0500 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 lAEHFNRb071350; Wed, 14 Nov 2007 12:15:24 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Kris Kennaway Date: Wed, 14 Nov 2007 11:31:56 -0500 User-Agent: KMail/1.9.6 References: <200711140543.lAE5ht3O020823@repoman.freebsd.org> <473AC77C.40903@FreeBSD.org> In-Reply-To: <473AC77C.40903@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200711141131.57204.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]); Wed, 14 Nov 2007 12:15:24 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/4779/Wed Nov 14 09:06:18 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, Julian Elischer , cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/i386/bios apm.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Wed, 14 Nov 2007 17:15:42 -0000 On Wednesday 14 November 2007 05:01:32 am Kris Kennaway wrote: > Julian Elischer wrote: > > julian 2007-11-14 05:43:55 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/i386/bios apm.c > > Log: > > Apply the same sort of locking done in > > sys/dev/acpica/acpi.c rev 1.196 a while ago: > > > > Grab Giant around calls to DEVICE_SUSPEND/RESUME in > > acpi_SetSleepState(). > > If we are resuming non-MPSAFE drivers, they need Giant held for them. > > This may fix some obscure suspend/resume problems. It has fixed keyrate > > setting problems that were triggered by cardbus (MPSAFE) changing the > > ordering for syscons resume (non-MPSAFE). Also, add some asserts that > > Giant is held in our suspend/resume and shutdown methods. > > > > Submitted by: Marko Zec > > > > Revision Changes Path > > 1.149 +10 -0 src/sys/i386/bios/apm.c > > Why are we adding new unconditional giant acquisitions to the tree? > Devices indicate whether or not they are mpsafe, why can't this be made > conditional? Actually, we have no way in new-bus to mark new-bus operations like bus enumeration, etc. MPSAFE, and much of it is not (e.g. attach/detach/suspend/resume, etc. functions). Additionally, making this conditional would require a scheme where you acquire Giant when you walk down the tree into a non-MPSAFE driver which would add complication to many (if not all) bus drivers. Considering the rarity of suspend/resume (not a critical-path) the overhead of adding all that may not be worth it. At some point when we do have locking for all device driver operations this can be removed, but it won't really hurt anything to leave it as it is for now. -- John Baldwin