From owner-cvs-src@FreeBSD.ORG Thu May 1 08:42:29 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 DDFE337B401; Thu, 1 May 2003 08:42:28 -0700 (PDT) Received: from magic.adaptec.com (magic-mail.adaptec.com [208.236.45.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9DF0C43FB1; Thu, 1 May 2003 08:42:25 -0700 (PDT) (envelope-from gibbs@scsiguy.com) Received: from redfish.adaptec.com (redfish.adaptec.com [162.62.50.11]) by magic.adaptec.com (8.11.6/8.11.6) with ESMTP id h41FdMZ29829; Thu, 1 May 2003 08:39:22 -0700 Received: from btc.btc.adaptec.com ([10.100.0.52]) by redfish.adaptec.com (8.8.8p2+Sun/8.8.8) with ESMTP id IAA19347; Thu, 1 May 2003 08:42:14 -0700 (PDT) Received: from [10.100.253.70] (aslan [10.100.253.70]) by btc.btc.adaptec.com (8.8.8+Sun/8.8.8) with ESMTP id JAA03346; Thu, 1 May 2003 09:42:08 -0600 (MDT) Date: Thu, 01 May 2003 09:42:09 -0600 From: "Justin T. Gibbs" To: John Baldwin Message-ID: <1721460000.1051803729@aslan.btc.adaptec.com> In-Reply-To: References: X-Mailer: Mulberry/3.0.3 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: cvs-all@freebsd.org cc: "M. Warner Losh" cc: Andrew Gallatin 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 Reply-To: "Justin T. Gibbs" List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 May 2003 15:42:29 -0000 > Yes, bus_teardown_intr() does block and people were complaining that it does. It seems to be the only way to do this cleanly unless you start playing with alternate interrupt stubs that happen to reside outside the module you are loading, etc. > The only problem that needs to be worked around (which you probably already > do) is to make sure that if the handler is currently blocked on the lock > when you do the teardown, it will not hose anything (like turn interrupts > back on) when it executes. For fxp(4), Warner used a 'gone' flag to make it > so that fxp_intr() returned immediately in that case. The fxp interrupt handler (at least in stable) doesn't re-enable interrupts. So, the above strategy should work for fxp too. >> This means that all detaches must occur from a context that can >> sleep, but that shouldn't be too hard to make happen. > > People can't hold the driver lock across bus_teardown_intr() with this > model, which does require a possibly smarter interrupt routine or > maybe a better detach that only disables interrupts then does a teardown, > then finishes shutting down the rest of the hardware along with an > interrupt handler that doesn't re-enable interrupts in the shutdown case. All doable things for all but really broken hardware. fxp is not broken. -- Justin