On Mon, 17 May 2004, Oliver Neukum wrote:

> CPU A                                 CPU B
> mov transfer_flags,R                  mov transfer_flags,R
> set_bit X,R                                   ................
> mov R,transfer_flags                  set_bit Y,R
> .....................                                 mov R,transfer_flag
> 
> Classical concurrent access to a nonatomic variable.
> 
> The whole point of usb_kill_urb() is _not_ to have synchronisation
> of completion handler and the context calling usb_kill_urb().
> usb_kill_urb() shall provide synchronisation by waiting for an urb
> to be dead and buried. It must provide as much locking as it needs
> and cannot depend on it without nullifying its own justification.

You are right.  There's no choice but to add another field for the Reject 
flag.

I've decided not to change the status codes.  Although no driver tries to 
tell the difference between synchronous and asynchronous unlinks (except 
one, where it's reported in a debugging message), this is the course of 
least resistance.

Patch to follow.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&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