> Here's another possibility.  For each usb_device we include a
> pre-allocated URB, together with a usb_ctrlrequest and a 64-byte buffer.  
> This URB could be used while holding the device lock, for things like
> get_descriptor, suspend, or reset.

Good idea.

> > An URB with its buffer preallocated is bound to a device, respectively
> > an endpoint, so it cannot complete without triggering the same irq the
> > completion handler is running in.
> 
> Ah yes.  Although I would prefer to make each URB & buffer bound to a 
> HC/bus, not to a device or endpoint -- but that doesn't affect your point.

Why? Drivers cannot share URBs among interfaces, unless you export
the concept of busses, which would violate layering.
Furthermore to a driver the interface is the natural unit of operation.
And the more specific an URB is the less usb_submit_urb() has to do.

> This would allow us to replace an atomic_t with an unsigned long and use 
> bit-operations rather than atomic_inc/atomic_dec.  It would improve 
> performance on the Sparc platform and wouldn't make much difference 
> anywhere else.

Indeed one bit would be enough.

        Regards
                Oliver


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&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