Date: Wed, 30 Apr 2003 11:20:56 +0200 (CEST) From: Harti Brandt <brandt@fokus.fraunhofer.de> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: nate@root.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h Message-ID: <20030430111247.W31027@beagle.fokus.fraunhofer.de> In-Reply-To: <6554.1051693803@critter.freebsd.dk> References: <6554.1051693803@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 30 Apr 2003, Poul-Henning Kamp wrote: PK>In message <20030430093931.V31027@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@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@fokus.fraunhofer.de, harti@freebsd.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030430111247.W31027>