From owner-freebsd-arch@FreeBSD.ORG Wed Jul 21 10:37:54 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 70A8716A4CE; Wed, 21 Jul 2004 10:37:54 +0000 (GMT) Received: from mail.qubesoft.com (gate.qubesoft.com [217.169.36.34]) by mx1.FreeBSD.org (Postfix) with ESMTP id B58B743D66; Wed, 21 Jul 2004 10:37:53 +0000 (GMT) (envelope-from dfr@nlsystems.com) Received: from bluebottle.qubesoft.com (bluebottle.qubesoft.com [192.168.1.2]) by mail.qubesoft.com (8.12.9/8.12.9) with ESMTP id i6LAbqkM070546; Wed, 21 Jul 2004 11:37:52 +0100 (BST) (envelope-from dfr@nlsystems.com) Received: from builder02.qubesoft.com (builder02.qubesoft.com [192.168.1.8]) i6LAbpON067331; Wed, 21 Jul 2004 11:37:51 +0100 (BST) (envelope-from dfr@nlsystems.com) From: Doug Rabson To: Poul-Henning Kamp In-Reply-To: <79980.1090401699@critter.freebsd.dk> References: <79980.1090401699@critter.freebsd.dk> Content-Type: text/plain Message-Id: <1090406270.7114.2.camel@builder02.qubesoft.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Wed, 21 Jul 2004 11:37:50 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 'clamd / ClamAV version 0.65', clamav-milter version '0.60p' cc: arch@freebsd.org cc: freebsd-arch@freebsd.org Subject: Re: kldunload DIAGNOSTIC idea... 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, 21 Jul 2004 10:37:54 -0000 On Wed, 2004-07-21 at 10:21, Poul-Henning Kamp wrote: > In message <200407211010.08159.dfr@nlsystems.com>, Doug Rabson writes: > > >The original intention was that drivers use the > >device_busy()/device_unbusy() counter to handle these things. In some > >cases, just calling device_busy() from fooopen() and device_unbusy() > >from fooclose() is sufficient. > > That is not enough. All methods in cdevsw, and things not in cdevsw > (clone handlers, call backs, etc etc) needs to refcount. > > I have a lot of this working in a tree here, and will commit it once > I have gone over it a few more times. Methods in cdevsw which can't be called unless the device is opened can rely on a single counter managed by open/close in most cases. Other callbacks may or may not need extra handling depending on whether or not the callback can persist past close. Will you use the existing device_busy() counter or will each driver use its own counter?