lkml.org 
[lkml]   [2004]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH: (as177) Add class_device_unregister_wait() and platform_device_unregister_wait() to the driver model core
On Fri, 23 Jan 2004, Linus Torvalds wrote:

> HOWEVER - I do worry when people start exporting interfaces that are
> basically _designed_ to deadlock. It's a bad interface. Don't export it.
> There is possibly just _one_ place that can do it, and it's the module
> unload part. Everything else would be a bug.

You know, this problem and other similar ones related to module unloading
would go away if modules behaved more like other kernel objects:

if they could be unregistered (rmmod) at any time, regardless
of their refcount;

if they would persist in an unregistered state, until they were
released (unloaded from memory) when the refcount dropped to 0.

Then it wouldn't be necessary for a module's exit routine to wait when
unregistering devices. A device could simply hold a reference to the
module; when the device was released and things were safe the module would
be unloaded. The one exception would no longer exist.

Is there some reason why modules don't work like this?

Alan Stern

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [W:0.143 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site