Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jan 2003 17:12:26 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Maxime Henrion <mux@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: if_dc.c locking patch
Message-ID:  <Pine.BSF.4.21.0301061709440.12472-100000@root.org>
In-Reply-To: <20030107010405.GB66404@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 6 Jan 2003, Maxime Henrion wrote:
> Nate Lawson wrote:
> > Attached is a diff that fixes a "could sleep" problem where
> > ether_ifattach() does a malloc and dc(4) is holding a lock in its softc.  
> > It uses a cleaner exit strategy with only one call to DC_UNLOCK and no
> > multiple return statements as well as fixing one place where "error"
> > wasn't set.  If people are ok with it, I'll sweep other drivers that have
> > a similar problem.
> 
> Doing this would maybe be a bit premature.  A lot of drivers have
> FOO_LOCK and FOO_UNLOCK macros set to nothing, because of similar
> problems you're trying to fix.  Interface locking probably needs to be
> rethought.

I appreciate the insight but this seems pretty straightforward -- if a
driver needs to muck with registers, it should use a per-device lock.  If
it needs to change global state (i.e. ether_ifattach), it's up to the
called subsystem to do its own locking.  The two are orthogonal.

-Nate


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?Pine.BSF.4.21.0301061709440.12472-100000>