From: Ishizaki Kou Date: Fri, 12 Jan 2007 00:52:41 +0000 (+0900) Subject: [POWERPC] spufs: Add SPU register lock X-Git-Tag: v2.6.21-rc2~42^2~3^2~97 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=3650cfe2e51432030e469afd75a429c199c4e42f;p=linux-2.6-omap-h63xx.git [POWERPC] spufs: Add SPU register lock spu->register_lock should be held before accessing registers. Signed-off-by: Kou Ishizaki Acked-by: Arnd Bergmann Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index bd7bffc3ddd..c43999a10de 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -170,9 +170,11 @@ int spu_irq_class_0_bottom(struct spu *spu) { unsigned long stat, mask; + unsigned long flags; spu->class_0_pending = 0; + spin_lock_irqsave(&spu->register_lock, flags); mask = spu_int_mask_get(spu, 0); stat = spu_int_stat_get(spu, 0); @@ -188,6 +190,7 @@ spu_irq_class_0_bottom(struct spu *spu) __spu_trap_error(spu); spu_int_stat_clear(spu, 0, stat); + spin_unlock_irqrestore(&spu->register_lock, flags); return (stat & 0x7) ? -EIO : 0; }