> From: David Brownell <[EMAIL PROTECTED]>
> Date: Sat, 20 Oct 2001 19:30:56 -0700

> The simplest answer is (b):
> 
> (b) usb_find_interface_driver() uses the dev->serialize semaphore
>       for exclusion, but usbdevfs uses the BKL instead.

This is not all, it uses driver->serialize() as well.
Using only dev->serialize() confuses drivers that expect
a single thread in probe(), and they do need a single thread
in proble because they need to initialize their mutual
exclusion primitives that they might use to serialize other calls.

> I think the quick fix would be make usbdevfs use dev->serialize
> like find_interface_driver(), and document that as a requrement in
> the calling convention for that routine.

Possibly. I defer to someone freshly reviewing that.

>     - usb_drivers_purge() uses driver->serialize while calling
>        disconnect() 
>     - usb_disconnect() does the same (driver->serialize)
> 
> I don't see how it can be correct to have one set of driver
> entries use one lock and the other use a different one, when
> they're both affecting the interface bindings.  I think it'd be
> more correct to use only dev->serialize.

driver->serialize is common between probe and disconnect.
Using dev->serialize would not work for the reason I pointed
out above: driver may attempt to set its globals in probe().

I realize that current Linux has statically initializeable
locking primitives which would allow a driver to self-serialize,
but I am not sure it would be wise to structure an API around
their availability.

-- Pete

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to