> The reason for doing this is historical; usb_hcd_giveback_urb() is
> documented as running with local IRQs disabled, and many drivers depend
> on that.  For example, their callback routines invoked by
> usb_hcd_giveback_urb do spin_lock() instead of spin_lock_irqsave().


> 
> So what's the best way to do this?  Should we do:
> 
>       spin_lock_irqsave(&some_lock, flags);
>       ...
>       spin_unlock(&some_lock);
>       usb_hcd_giveback_urb(hcd, urb);
>       local_irq_restore(flags);
> 
> or is there a better approach?

Why not just bite the bullet and change the callback convention. The lock
verification code should catch the cases that matter and which are
overlooked on a code scan. You could also change the name of the callback
to be sure it breaks anything out of tree that isn't fixed.

Alan

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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