From owner-freebsd-arch@FreeBSD.ORG Wed Sep 8 22:00:57 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF69F16A4CE for ; Wed, 8 Sep 2004 22:00:57 +0000 (GMT) Received: from green.homeunix.org (pcp04368961pcs.nrockv01.md.comcast.net [69.140.212.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C9BC43D2F for ; Wed, 8 Sep 2004 22:00:57 +0000 (GMT) (envelope-from green@green.homeunix.org) Received: from green.homeunix.org (green@localhost [127.0.0.1]) by green.homeunix.org (8.13.1/8.13.1) with ESMTP id i88M0tTU079460; Wed, 8 Sep 2004 18:00:55 -0400 (EDT) (envelope-from green@green.homeunix.org) Received: (from green@localhost) by green.homeunix.org (8.13.1/8.13.1/Submit) id i88M0spV079459; Wed, 8 Sep 2004 18:00:54 -0400 (EDT) (envelope-from green) Date: Wed, 8 Sep 2004 18:00:54 -0400 From: Brian Fundakowski Feldman To: Poul-Henning Kamp Message-ID: <20040908220054.GH928@green.homeunix.org> References: <20040908.145846.71090050.imp@bsdimp.com> <47831.1094677844@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <47831.1094677844@critter.freebsd.dk> User-Agent: Mutt/1.5.6i cc: arch@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/usb ugen.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2004 22:00:58 -0000 On Wed, Sep 08, 2004 at 11:10:44PM +0200, Poul-Henning Kamp wrote: > In message <20040908.145846.71090050.imp@bsdimp.com>, "M. Warner Losh" writes: > >It turns out that Brian's change typically is the same as the old > >code. However, there are a few cases where it isn't: > > > >(1) Where the application doesn't close the device when it gets an > > error. Stupid application, I know, but in this case the device > > never detaches. This is one of the things that caused our > > appliction to die with the new code, but not the old code. phk's > > work with deadfs and dev_t ref counting may help here. > > The intent is that devfs will act as isolator for drivers which > disintegrate, in other words, even if the application does not close > and go away, devfs will make it go away from the drivers point of > view. The refcounting necessary is not in place currently, I ran > into a funky detail and got derailed. > > Problem is that we can't just declare that destroy_dev() will evict > all threads because we do not know what they might be sleeping > on/for while they are inside the driver. A two phase scheme is > necesary where the driver first blocks future entry, then evicts > any threads already in there and then calls destroy_dev(). > > I've done some work on this based on the phk_tty branch in p4, but > it was pretty exploratory. The challenge with ttys is that the > struct tty might referenced as controlling tty even after the last > close. > > Once I get this sorted out, I'll aim at getting phk_tty MFP4'ed. FWIW, this is also interesting from a network driver standpoint which has little to do with dev. It would be nice to make all ifnets devs.... -- Brian Fundakowski Feldman \'[ FreeBSD ]''''''''''\ <> green@FreeBSD.org \ The Power to Serve! \ Opinions expressed are my own. \,,,,,,,,,,,,,,,,,,,,,,\