Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 05 Dec 2004 15:26:56 -0700 (MST)
From:      Warner Losh <imp@harmony.village.org>
To:        nate@root.org
Cc:        imp@bsdimp.com
Subject:   Re: cvs commit: src/sys/dev/acpica acpi.c
Message-ID:  <20041205.152656.74710024.imp@harmony.village.org>
In-Reply-To: <41B388C6.5090409@root.org>
References:  <200412050135.iB51ZJJl040909@repoman.freebsd.org> <20041204.221541.115654786.imp@bsdimp.com> <41B388C6.5090409@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Nate Lawson <nate@root.org>
Subject: Re: cvs commit: src/sys/dev/acpica acpi.c
Date: Sun, 05 Dec 2004 14:16:38 -0800

> M. Warner Losh wrote:
> > In message: <200412050135.iB51ZJJl040909@repoman.freebsd.org>
> >             Nate Lawson <njl@FreeBSD.org> writes:
> > :   If we are resuming non-MPSAFE drivers, they need Giant held for them.
> > 
> > Generally, when walking the device tree, one must have Giant.  I've
> > been meaning to add asserts for this in the tree...  I think that we
> > have enough things giant is pushed out of that it is time...
> 
> I'd like that.  I think the GIANT_REQUIRED asserts should go in the 
> root_bus suspend/resume/shutdown methods, not in acpi.  This will cover 
> everyone unless a driver drops Giant and doesn't reacquire it (unlikely).

Agreed.  I'm moving stuff in as soon as I verify that it works, or has
a high likelood of succeeding.  There's a few other places I want to
add them as well, and will do so over the coming weeks.

Drivers aren't allowed to drop Giant in these calls.  Giant is used to
control the layout of the device tree at the moment, and if you drop
Giant, then you can get back into the code that changes the layout of
the tree.  I plan on fixing this in the future, but at the moment, you
must not drop Giant.  And you also should have Giant on any calls to
device_get_children and hold it until just before the free of the
child list.

Once I have all the Giant asserts in place, I plan on moving forward
with removing the need for Giant, but right now the restrictions are
what they are...

Warner



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