Re: [PATCH]generic usb serial driver

Oliver Neukum <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Novell
Message-ID <[email protected]>
Am Freitag, 30. März 2007 22:59 schrieb David Brownell:
> On Friday 30 March 2007 1:38 pm, Oliver Neukum wrote:
> > Am Freitag, 30. März 2007 22:04 schrieb David Brownell:
> > > Remember that if every completion callback does
> > > 
> > >         status = urb->status;
> > > 
> > > at the top, the urb->status issue will by definition go away.  That's
> > 
> > Only if it does smp_mb(), which is the whole point of this thread.
> 
> Nope.  If an smp_mb() is needed, the reason is because of other
> driver-internal bugs.
> 
> Remember that the driver isn't allowed to so much as *LOOK* at any
> field of an URB until the completion callback.  That generalizes:
> it mustn't do so until that callback (cleanly) hands the URB back

Yes and the callback is guaranteed that all the urb's fields are
valid. Which is the whole point. Is that guarantee only valid to the
callback or to the whole driver?

CPU A (callback)			CPU B

flag = 1;					if (!flag) barrier();
a = urb->status;			b = urb->status;

Do we guarantee a==b or don't we?

	Regards
		Oliver

PS: Alan to CC because he looked at that stuff in detail

-------------------------------------------------------------------------
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
_______________________________________________
[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.