Commit 3650cfe2 authored by Ishizaki Kou's avatar Ishizaki Kou Committed by Paul Mackerras

[POWERPC] spufs: Add SPU register lock

spu->register_lock should be held before accessing registers.
Signed-off-by: default avatarKou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent c5365313
...@@ -170,9 +170,11 @@ int ...@@ -170,9 +170,11 @@ int
spu_irq_class_0_bottom(struct spu *spu) spu_irq_class_0_bottom(struct spu *spu)
{ {
unsigned long stat, mask; unsigned long stat, mask;
unsigned long flags;
spu->class_0_pending = 0; spu->class_0_pending = 0;
spin_lock_irqsave(&spu->register_lock, flags);
mask = spu_int_mask_get(spu, 0); mask = spu_int_mask_get(spu, 0);
stat = spu_int_stat_get(spu, 0); stat = spu_int_stat_get(spu, 0);
...@@ -188,6 +190,7 @@ spu_irq_class_0_bottom(struct spu *spu) ...@@ -188,6 +190,7 @@ spu_irq_class_0_bottom(struct spu *spu)
__spu_trap_error(spu); __spu_trap_error(spu);
spu_int_stat_clear(spu, 0, stat); spu_int_stat_clear(spu, 0, stat);
spin_unlock_irqrestore(&spu->register_lock, flags);
return (stat & 0x7) ? -EIO : 0; return (stat & 0x7) ? -EIO : 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment