On Sun, 17 Apr 2005, Oliver Neukum wrote:

> > Using spin_lock_bh() in enqueue or dequeue isn't a solution because 
> > existing code already calls these routines with interrupts disabled.
> 
> How so? If you convert the irq code to a tasklet, it'll run in a tasklet.

Yes it will.  But it will still disable interrupts before calling
completion handlers.  It has to; that's a guarantee of the API.  So if a
completion handler resubmits its URB, that submission will have to be
handled with interrupts disabled.

Furthermore, there's nothing to prevent USB device drivers from calling
usb_submit_urb() or usb_unlink_urb() while they have disabled interrupts
for their own reasons.  That's a perfectly legal thing to do, but again it
means that enqueue and dequeue can be called with interrupts disabled.

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