cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h

Harti Brandt brandt at fokus.fraunhofer.de
Wed Apr 30 02:21:05 PDT 2003


On Wed, 30 Apr 2003, Poul-Henning Kamp wrote:

PK>In message <20030430093931.V31027 at beagle.fokus.fraunhofer.de>, Harti Brandt wri
PK>tes:
PK>>On Tue, 29 Apr 2003, M. Warner Losh wrote:
PK>>
PK>>MWL>In message: <Pine.BSF.4.21.0304291101001.75697-100000 at root.org>
PK>>
PK>>MWL>: >           4) Return immediately if gone is true in fxp_ioctl
PK>>MWL>: >           5) Return immediately if gone is true in fxp_intr
PK>>MWL>:
PK>>MWL>: Not sure this approach is necessary.
PK>>MWL>
PK>>MWL>I am.  Otherwise ioctl panics with recursive locks when the card is
PK>>MWL>detached.  A simple kld_unload if_fxp would provoke these races,
PK>>MWL>including the recursive lock panic.
PK>>
PK>>You can replace the pointers to ioctl and start with pointers to dummy
PK>>functions. In fact, an if_dead(ifp) function which does just this would
PK>>be nice to have.
PK>
PK>isn't that what if_disc.c does already ?

Not really. Its just a 'loopback' that drops packets. It even has a
real ioctl function. What I meant is something like:

foo_detach(..)
{
	LOCK(sc);
	ifp->if_ioctl = if_dead_ioctl;
	ifp->if_start = if_dead_start;
	...
	UNLOCK(sc);
	...
}

where if_dead_ioctl just returns an error.

The problem remains how to get all threads that have been block while we
had the lock on sc out of the old ioctl. (probably by some kind of loop on
mtx_trylock). But we are at least sure, that no new threads enter our
ioctl.

harti
-- 
harti brandt,
http://www.fokus.fraunhofer.de/research/cc/cats/employees/hartmut.brandt/private
brandt at fokus.fraunhofer.de, harti at freebsd.org


More information about the cvs-src mailing list