diff options
author | Ishizaki Kou <kou.ishizaki@toshiba.co.jp> | 2007-01-11 19:52:41 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-01-24 05:13:59 -0500 |
commit | 3650cfe2e51432030e469afd75a429c199c4e42f (patch) | |
tree | 7d7d94ff4afa30ef71b45eb7808f3c61e8993f9b | |
parent | c53653130f2868e44c6e8346d110d27d39e7d07b (diff) |
[POWERPC] spufs: Add SPU register lock
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>
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index bd7bffc3ddd0..c43999a10deb 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -170,9 +170,11 @@ int | |||
170 | spu_irq_class_0_bottom(struct spu *spu) | 170 | spu_irq_class_0_bottom(struct spu *spu) |
171 | { | 171 | { |
172 | unsigned long stat, mask; | 172 | unsigned long stat, mask; |
173 | unsigned long flags; | ||
173 | 174 | ||
174 | spu->class_0_pending = 0; | 175 | spu->class_0_pending = 0; |
175 | 176 | ||
177 | spin_lock_irqsave(&spu->register_lock, flags); | ||
176 | mask = spu_int_mask_get(spu, 0); | 178 | mask = spu_int_mask_get(spu, 0); |
177 | stat = spu_int_stat_get(spu, 0); | 179 | stat = spu_int_stat_get(spu, 0); |
178 | 180 | ||
@@ -188,6 +190,7 @@ spu_irq_class_0_bottom(struct spu *spu) | |||
188 | __spu_trap_error(spu); | 190 | __spu_trap_error(spu); |
189 | 191 | ||
190 | spu_int_stat_clear(spu, 0, stat); | 192 | spu_int_stat_clear(spu, 0, stat); |
193 | spin_unlock_irqrestore(&spu->register_lock, flags); | ||
191 | 194 | ||
192 | return (stat & 0x7) ? -EIO : 0; | 195 | return (stat & 0x7) ? -EIO : 0; |
193 | } | 196 | } |