On Wed, 26 Jan 2005 11:31:07 +0300, Evgeniy Polyakov <[EMAIL PROTECTED]> wrote: > On Tue, 2005-01-25 at 22:42 +0000, Christoph Hellwig wrote: > > > Yes, and it is better than removing module whose structures are in use. > > > SuperIO core is asynchronous in it's nature, one can use logical device > > > through superio core and remove it's module on other CPU, above loop > > > will > > > wait untill all reference counters are dropped. > > > > General rule is: increment module reference count while the hardware > > is actually in use, and let device structures be allocated by the > > bus core so drivers can be freed with them still allocated. That's > > how the driver model and thus about every other subsystem works. > > It is not general rule - network stack does not have such mechanism, > which is > very good, I doubt each block device module increment it's module > reference > when it catch a request... > It is internal structure that has reference counter, not module itself, > and this > structure may be in use, when module is unloaded, thus unloading must > wait, > untill all it's structures are freed. >
No, it does not necessarily has to wait. You can unload driver at any time if you care to mark all its devices as "dead" and you have generic release function in a separate module that does not get unloaded until last registered device has been destroyed. Look for example at serio code. I think USB is about the same. -- Dmitry - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/