From owner-cvs-src@FreeBSD.ORG Wed Apr 30 02:21:05 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA30A37B401; Wed, 30 Apr 2003 02:21:04 -0700 (PDT) Received: from mailhub.fokus.fraunhofer.de (mailhub.fokus.fraunhofer.de [193.174.154.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC8E343FAF; Wed, 30 Apr 2003 02:21:02 -0700 (PDT) (envelope-from brandt@fokus.fraunhofer.de) Received: from beagle (beagle [193.175.132.100])h3U9KvE16762; Wed, 30 Apr 2003 11:20:57 +0200 (MEST) Date: Wed, 30 Apr 2003 11:20:56 +0200 (CEST) From: Harti Brandt To: Poul-Henning Kamp In-Reply-To: <6554.1051693803@critter.freebsd.dk> Message-ID: <20030430111247.W31027@beagle.fokus.fraunhofer.de> References: <6554.1051693803@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org cc: "M. Warner Losh" cc: nate@root.org Subject: Re: cvs commit: src/sys/dev/fxp if_fxp.c if_fxpvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2003 09:21:05 -0000 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: 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