From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Owens Date: Fri, 05 Oct 2001 07:28:46 +0000 Subject: Re: Unloading drivers, start-up, shut-down and a rewrite (a problem) Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, 05 Oct 2001 00:13:15 -0700, David Brownell wrote: >Quoting David Hinds: >> Just so you know, and not saying whether it is a better or worse >> solution, the way PCMCIA drivers handle this, is that there's a >> separate interface, /proc/bus/pccard/drivers, that has "use counts" >> for PCMCIA drivers that indicate how many physical devices are >> currently associated with each driver. These use counts are >> independent of the regular module use counts. > >And FWIW, when I've thought of how to solve this "driver unload" >problem in a clean way that improves user-friendliness, that's just >what I end up wanting: a devices-per-driver count that's distinct >from the existing uses-per-driver refcount. I am not convinced that we need a separate count, at least not at the bottom layer. The module use count is a pure reference count on the module code, rmmod does not care what the types of reference are, rmmod just cares if it is safe to unload the code. >Likely "rmmod" needs a flag that says whether the device count is >ignored, as (effectively) done today. Driver developers will want the >flexibility to say "remove this driver even though there's hardware >attached, I've got a bugfix". USB developers work in that mode >today, it's quite handy. See above, I don't see any need to distinguish between references. If the device is up then the module cannot be unloaded. That does assume that all devices can be deactivated which is not currently true, to do this properly every device driver would need an up and a down routine. I can add a use count up/down interface to kernel/module.c without waiting for every driver to be converted to an up/down interface. However we have to agree on a common design for drivers, I would hate to see some modules supporting up/down and others doing it a different way. _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel