From owner-cvs-all@FreeBSD.ORG Tue Jul 13 20:42:42 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7A76516A4CE; Tue, 13 Jul 2004 20:42:42 +0000 (GMT) Received: from www.cryptography.com (li-22.members.linode.com [64.5.53.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3531E43D45; Tue, 13 Jul 2004 20:42:42 +0000 (GMT) (envelope-from nate@root.org) Received: from [10.0.0.34] (adsl-63-195-111-154.dsl.snfc21.pacbell.net [63.195.111.154]) by www.cryptography.com (8.12.8/8.12.8) with ESMTP id i6DKgerb028465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 13 Jul 2004 13:42:41 -0700 Message-ID: <40F44940.4020406@root.org> Date: Tue, 13 Jul 2004 13:42:40 -0700 From: Nate Lawson User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Poul-Henning Kamp References: <23944.1089748527@critter.freebsd.dk> In-Reply-To: <23944.1089748527@critter.freebsd.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/kldunload kldunload.8 kldunload.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2004 20:42:42 -0000 Poul-Henning Kamp wrote: > In message <40F43D36.2000407@root.org>, Nate Lawson writes: > >>Have you kept up on the newbus discussions? The tentative plan was to >>add quiesce functionality to it as part of device_detach(). Doing it at >>the module layer is a bit too low since there are events that can >>trigger a detach but not an unload. For instance, any driver compiled >>into the kernel for an ejectable device will never be unloaded, but >>certainly should quiesce/detach when the device is ejected. Getting it >>right in newbus automatically fixes the problem you're trying to solve >>since a module unload always triggers a call to device_detach() but not >>vice versa. >> >>I think duplicating this at multiple layers is not a good idea and the >>module level is not the right layer to implement it. > > Well, since one kld can contain multiple modules, and since the modules > get to veto an unload with MOD_UNLOAD, I don't really see how you can > come up with something that doesn't have a MOD_QUIESCE. There are two parts, the internal structure and interfaces. The internal structure should obviously be one or more calls to device_detach(). The external interface does not exist yet and you're welcome to contribute. There is at least a usermode component ("eject ed0") and a kernel mode component ("this device_t will soon be gone"). Of course, there will be more than this. To address your specific issue, there doesn't have to be MOD_QUIESCE. The normal MOD_UNLOAD request will trigger (multiple calls to) device_detach via a TBD kernel interface. This detach needs to be multiple pass (notify, gone). > The fact that we have many modules which know nothing about newbus > also look like a pretty solid argument for needing it at the module > layer. Let's focus on how to improve things, not the fact that things aren't perfect right now. -- -Nate