Re: 2.6.11-rc2-mm1

From: Dmitry Torokhov
Date: Wed Jan 26 2005 - 08:33:20 EST


On Wed, 26 Jan 2005 11:31:07 +0300, Evgeniy Polyakov
<johnpol@xxxxxxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/