On Wed, 16 Mar 2005 [EMAIL PROTECTED] wrote:

> The problem is not reference counting the problem is some code in
> driver/base/bus.c. First I will describe the scenario:

> All is well and we call the driver remove function which calls 
> acm_disconnect. acm_disconnect calls usb_driver_release_interface
> with the other interface which re-enters device_release_driver
> and removes its entry from the list. Unfortunately this call
> detaches driver_detach's next pointer from the
> list it is iterating over so when we return from the outside call 
> of device_release_driver next->next is itself and will never be 
> equal to the list head which is list_for_each_safe's loop end
> condition. This is very bad.
> 
> I don't really understand why this is such an unusual situation
> but it results from us freeing the interfaces in a different order
> to that we claim them in - shouldn't the device driver interface
> handle this - at least without an infinite loop?
> 
> As far as I can see device_release_driver should *never* be called
> from somewhere which is called from device_release_driver with
> the current implimentation and I really can't understand that this has
> never happened before...

This is exactly the sort of thing that would be cured by removing the 
subsystem rwsem and changing the internal operation of the driver-model 
core.  Another problem that would be solved is adding/deleting devices 
during a probe(), remove(), or resume() callback.

Greg, I've got some pretty good ideas about how to do it.  But they're not
fully developed and I need help settling some issues.  What's a good
mailing list to discuss these things on?  LKML?

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to