Alan Cox wrote: >> 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);
This would, unfortunately, break RT too. In RT spin_lock_irqsave and spin_unlock(); local_irq_restore(flags); are not compatible. That would actually cause more harm. >> >> 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. > I agree with Alan Cox's approach. Bite the bullet and go and change the cases that depend on it. Run with Ingo's lock validator on, and it should catch anything that you miss manually. -- Steve ------------------------------------------------------------------------- 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