Skip to content

Commit

Permalink
[POWERPC] spufs: Add SPU register lock
Browse files Browse the repository at this point in the history
spu->register_lock should be held before accessing registers.

Signed-off-by: Kou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Ishizaki Kou authored and Paul Mackerras committed Jan 24, 2007
1 parent c536531 commit 3650cfe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}
Expand Down

0 comments on commit 3650cfe

Please sign in to comment.