[Cbe-oss-dev] [PATCH 3/3] spufs context switch - fix interrupt routing

Benjamin Herrenschmidt benh at kernel.crashing.org
Tue Apr 22 09:11:18 EST 2008


On Mon, 2008-04-21 at 18:09 -0300, Luke Browning wrote:
> On Thu, 2008-04-17 at 17:52 +1000, Jeremy Kerr wrote:
> > Luke,
> > 
> > > Index: public_git/arch/powerpc/platforms/cell/spufs/switch.c
> > > ===================================================================
> > > --- public_git.orig/arch/powerpc/platforms/cell/spufs/switch.c
> > > +++ public_git/arch/powerpc/platforms/cell/spufs/switch.c
> > > @@ -762,6 +762,7 @@ static inline void enable_interrupts(str
> > >  	spu_int_mask_set(spu, 0, 0ul);
> > >  	spu_int_mask_set(spu, 1, class1_mask);
> > >  	spu_int_mask_set(spu, 2, 0ul);
> > > +	eieio();
> > >  	spin_unlock_irq(&spu->register_lock);
> > >  }
> > 
> > do we need the eieio() here? I would have thought that the spin_unlock 
> > provides sufficient ordering.
> > 
> Depends on whether spin_unlock_irq() includes a lwsync or a sync.  If
> sync, the eieio is not needed.  Otherwise it is.  I recall seeing other
> places in this code where we had eieio following by the unlock.

No, it's not needed because spin-locks provide ordering with MMIO, look
at the accessors source code. More specifically, any MMIO store sets a
per-cpu flag. When this is set, spin_unlock will do a sync.

Cheers,
Ben.





More information about the cbe-oss-dev mailing list