Seems like the essence of as163 is to shift costs around a bit,
using device_register (instead of device_initialize + device_add)
because interface->dev.complete only fires on paths where the
refcount goes to zero ... and since that's the only mechanism
provided in the driver core to handle problem drivers which return
from disconnect() without releasing all references.

Seems reasonable to me.  Does this help with that "reset into
new firmware" path?


@@ -804,12 +804,16 @@
if (dev->actconfig) {
for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
struct usb_interface *interface;
+ struct completion intf_completion;
/* remove this interface */
interface = dev->actconfig->interface[i];
dev_dbg (&dev->dev, "unregistering interface %s\n",
interface->dev.bus_id);
- device_del(&interface->dev);
+ init_completion (&intf_completion);
+ interface->dev.complete = &intf_completion;
+ device_unregister (&interface->dev);
+ wait_for_completion (&intf_completion);

Couldn't you just call device_unregister_wait(&interface->dev)?


That looks to do all the completion stuff for you.  I suspect that
a lot of code should be calling that _wait version.

- Dave




------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to