Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Nov 2007 16:15:36 +0000
From:      Marko Zec <zec@icir.org>
To:        cvs-src@freebsd.org
Cc:        Kris Kennaway <kris@freebsd.org>, src-committers@freebsd.org, Julian Elischer <julian@freebsd.org>, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/i386/bios apm.c
Message-ID:  <200711141615.36829.zec@icir.org>
In-Reply-To: <473AC77C.40903@FreeBSD.org>
References:  <200711140543.lAE5ht3O020823@repoman.freebsd.org> <473AC77C.40903@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 14 November 2007 10:01:32 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?

In this case APM is the initiator, i.e. it is attempting to suspend / 
resume all devices in the tree.  If Giant is not held at that point, 
suspend handlers for non-mpsafe won't get executed, and as a result 
many such devices (USB in particular) won't work once the machine wakes 
up.  ACPI does exactly the same thing already.

Though I'm not sure if I've answered your question...

Marko



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711141615.36829.zec>