On Mon, 25 Apr 2005, Roman Kagan wrote:

> > But it is needed for the klist version.  I didn't send a patch for that
> > version because I don't have the -mm kernel source handy.  The analogous
> > change to the code should work, however.
> 
> OK then a matching change to usb_driver_claim_interface would be needed
> too.

I think usb_driver_claim_interface is correct as it stands.  It was a 
mistake to leave out from usb_driver_release_interface originally the line 
setting iface->condition to USB_INTERFACE_UNBINDING.

> > Probably this is something you've missed.  Let's say a driver X bound to
> > device D is rmmod'ed at the same time that driver Y is insmod'ed.
> > [...]
> >     device_bind_driver calls klist_add_tail for D.  But D's
> >     knode_driver is still on X's klist_devices!
> 
> Yes the scenario was on the surface, I just thought that this last step,
> where knode is added to a list before being released from another, is
> excluded by the klist core.

No, it isn't excluded.  The klist core just overwrites the pointers.

>  At any rate the driver can check for
> klist_node_attached(&dev->knode_bus) before claiming the device, and
> leave it alone if it's already attached to another driver.

You mean ->knode_driver, not ->knode_bus.

The _driver_ shouldn't check.  The check should be part of the
driver-model core in __driver_attach, at the place where it checks whether
the device is already bound to a driver.  In fact, this check can subsume
that one, since the klist_node will always be attached whenever the device 
is bound.

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