[Cbe-oss-dev] [PATCH 3:10] spufs: fix spu status read in spu_stopped()

Michael Ellerman michael at ellerman.id.au
Fri May 23 20:11:12 EST 2008


On Thu, 2008-05-22 at 23:09 +0000, Luke Browning wrote:
> On Fri, 2008-05-23 at 11:22 +1000, Michael Ellerman wrote:
> > On Thu, 2008-05-22 at 20:09 +0000, Luke Browning wrote:
> > > Fix spu status read in spu_stopped()
> > > 
> > > If the spu is stopping, re-read the register to get the stopped value.
> > > SPU status is a loop control variable in the calling routine.
> > > 
> > > Changed loop style based on Christoph Hellwig's comment.  
> > > 
> > > Added smp_wmb (lwsync) per CBEA specification of spu status register read.
> > 
> > What happens if I build a UP kernel, smp_wmb() will degenerate to a
> > compiler barrier, is that what you want to happen?
> 
> Compiler barrier, assuming that is a sync, would work also as it is a
> super set of what is needed.  

A compiler barrier doesn't result in any code, it's just a barrier to
prevent the compiler moving code around. So that won't work on UP - it
should be an explicit eieio().

> > And isn't smp_wmb() == eieio()? Or was it changed recently? Either way
> > if the spec says you need an lwsync I think you should use exactly that,
> > not some macro that could be changed in future.
> > 
> 
> I meant eieio().  Not lwsync.  

Can you update the comment then :)

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20080523/42e15ea1/attachment.pgp>


More information about the cbe-oss-dev mailing list