[I assume that the other recipients don't care about these technical 
details.]

On Mon, 4 Oct 2004, Greg KH wrote:

> Alan, these error messages lead me to believe that the error recovery
> code in the uhci driver doesn't quite work properly, as even if the
> register of the pci driver fails, we shouldn't error out with this mess,
> right?

I don't think there's a problem with error recovery in the UHCI driver.  
There are certain guarantees that usbcore makes, and what happened here
was breaking those guarantees.

In particular, device registration actually worked correctly and usbcore 
called the uhci_start() routine to initialize the data structures and 
hardware for the controller.  (Among other things, that routine allocates 
entries from its slab cache and creates a file in /proc/uhci.)  In return, 
the core is supposed to call uhci_stop() when the driver is unloaded, so 
that the driver can undo everything done by uhci_start().

But what happened here was that although the registration worked
correctly, the return code indicated that it had failed.  So the driver
simply tried to exit, and uhci_stop() was never called.  The consequences,
as you saw, included trying to deallocate a slab cache in which not all
the entries were free and trying to remove a procfs directory that wasn't
empty.

If the registration really _had_ failed, the slab-cache entries wouldn't 
have been allocated and the procfs file wouldn't have been created.  Hence 
none of the mess would have occurred.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to