Messages in this thread | | | Date | Mon, 26 Jan 2004 16:50:35 +1100 | From | Rusty Russell <> | Subject | Re: PATCH: (as177) Add class_device_unregister_wait() and platform_device_unregister_wait() to the driver model core |
| |
On Fri, 23 Jan 2004 10:11:06 -0800 Greg KH <greg@kroah.com> wrote:
> On Fri, Jan 23, 2004 at 09:42:09AM -0800, Linus Torvalds wrote: > > > > > > On Fri, 23 Jan 2004, Alan Stern wrote: > > > > > > Since I haven't seen any progress towards implementing the > > > class_device_unregister_wait() and platform_device_unregister_wait() > > > functions, here is my attempt. > > > > So why would this not deadlock? > > It will deadlock if the user does something braindead like: > rmmod foo < /sys/class/foo_class/foo1/file
Um, if module foo exports a class, then why doesn't opening the class file bump the owner count so the above will fail?
If you want to safely remove parts of the kernel, you have to maintain reference counts. At least with any sane scheme I've seen.
I know, I should go read the code... Rusty. -- there are those who do and those who hang on and you don't see too many doers quoting their contemporaries. -- Larry McVoy - 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/
| |