On Sat, 31 Mar 2007, Oliver Neukum wrote:

> Am Samstag, 31. März 2007 04:59 schrieb Alan Stern:
> > isn't clean -- but several drivers do it this way.  I'm not even certain 
> > that adding smp_mb() to the completion routine will really fix it; memory 
> > barriers have to be used in pairs, and so there would also need to be a 
> > barrier between the test of private_data->urb_done and the call to 
> > use(urb).
> > 
> 
> In the example you have given smp_rmb() would be required.
> However we have:
> 
> CPU A                         CPU B
> a = urb->status                       if (flag)
> flag = 1                                      urb->status = x
> 
> abstractly speaking. CPU A needs a memory barrier.
> 
> Are you saying that CPUs may do speculative _writes_ ?

No, they don't.  You're right that in this case CPU B doesn't need a 
memory barrier.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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