Re: RT-friendly IRQ management in USB

Alan Cox <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Red Hat UK Cyf., Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, Y Deyrnas Gyfunol. Cofrestrwyd yng Nghymru a Lloegr o'r rhif cofrestru 3798903
Message-ID <[email protected]>
> 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/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.