Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 10:58:25 +0100 (CET)
From:      Harti Brandt <brandt@fokus.gmd.de>
To:        Nate Lawson <nate@root.org>
Cc:        current@FreeBSD.ORG, <net@FreeBSD.ORG>
Subject:   Re: Proper -current if_attach locking?
Message-ID:  <20030106105529.C12568-100000@beagle.fokus.gmd.de>
In-Reply-To: <Pine.BSF.4.21.0301031458210.99923-100000@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 3 Jan 2003, Nate Lawson wrote:

NL>I was looking into some "could sleep messages" and found some bogus
NL>locking in the attach routine of many drivers.  Several init a mtx in
NL>their softc and then lock/unlock it in their attach routine.  This, of
NL>course, does nothing to provide exclusive access to a device.  I assume
NL>there is going to be a global IF_LOCK or something to be used in attach
NL>routines.  Can someone fill me in on the intended design?

Probably not. I asked the same question a couple of month ago and got 0
answers. I think, there is no way, the driver itself can assure exclusive
access to the device it is attaching. It *must* assume, that there is some
kind of locking around the call to the attach routine. Getting the lock in
the softc inside the attach routine may be neccessary, because the routine
may call other functions that assume they have the lock.

harti
-- 
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
              brandt@fokus.gmd.de, brandt@fokus.fhg.de


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




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