lkml.org 
[lkml]   [2003]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [linux-usb-devel] Re: [OOPS, usbcore, releaseintf] 2.6.0-test10-mm1
Date
> In an earlier message I wrote that the HC driver couldn't unload so long
> as the device usbfs was using held a reference to its bus. I just did
> some checking, and guess what: It can!

Uh oh.

> I looked at both the UHCI and OHCI drivers. In their module_exit routines
> they call pci_unregister_driver(). Without knowing how the PCI subsystem
> works, I would assume this behaves like any other "deregister" routine in
> the driver model and returns without waiting for any reference count to go
> to 0 -- that's what release callbacks are for.
>
> However, the module_exit routines _don't_ wait for the release callbacks.
> They just go right on ahead and exit. Result: when the reference count
> eventually does go to 0 (when usbfs drops its last reference), the
> hcd_free routine is no longer present and you get an oops.
>
> The proper fix would be to have each HC driver keep track of how many
> instances are allocated. The module_exit routine must wait for that
> number to drop to 0 before returning.

Is this how it is usually done?

All the best,

Duncan.
-
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 13:59    [W:0.099 / U:3.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site