diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 095a30304c56..106d2921e2d9 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -236,27 +236,34 @@ static irqreturn_t | |||
236 | spu_irq_class_0(int irq, void *data) | 236 | spu_irq_class_0(int irq, void *data) |
237 | { | 237 | { |
238 | struct spu *spu; | 238 | struct spu *spu; |
239 | unsigned long stat, mask; | ||
239 | 240 | ||
240 | spu = data; | 241 | spu = data; |
241 | spu->class_0_pending = 1; | 242 | |
243 | mask = spu_int_mask_get(spu, 0); | ||
244 | stat = spu_int_stat_get(spu, 0); | ||
245 | stat &= mask; | ||
246 | |||
247 | spin_lock(&spu->register_lock); | ||
248 | spu->class_0_pending |= stat; | ||
249 | spin_unlock(&spu->register_lock); | ||
250 | |||
242 | spu->stop_callback(spu); | 251 | spu->stop_callback(spu); |
243 | 252 | ||
253 | spu_int_stat_clear(spu, 0, stat); | ||
254 | |||
244 | return IRQ_HANDLED; | 255 | return IRQ_HANDLED; |
245 | } | 256 | } |
246 | 257 | ||
247 | int | 258 | int |
248 | spu_irq_class_0_bottom(struct spu *spu) | 259 | spu_irq_class_0_bottom(struct spu *spu) |
249 | { | 260 | { |
250 | unsigned long stat, mask; | ||
251 | unsigned long flags; | 261 | unsigned long flags; |
252 | 262 | unsigned long stat; | |
253 | spu->class_0_pending = 0; | ||
254 | 263 | ||
255 | spin_lock_irqsave(&spu->register_lock, flags); | 264 | spin_lock_irqsave(&spu->register_lock, flags); |
256 | mask = spu_int_mask_get(spu, 0); | 265 | stat = spu->class_0_pending; |
257 | stat = spu_int_stat_get(spu, 0); | 266 | spu->class_0_pending = 0; |
258 | |||
259 | stat &= mask; | ||
260 | 267 | ||
261 | if (stat & 1) /* invalid DMA alignment */ | 268 | if (stat & 1) /* invalid DMA alignment */ |
262 | __spu_trap_dma_align(spu); | 269 | __spu_trap_dma_align(spu); |
@@ -267,7 +274,6 @@ spu_irq_class_0_bottom(struct spu *spu) | |||
267 | if (stat & 4) /* error on SPU */ | 274 | if (stat & 4) /* error on SPU */ |
268 | __spu_trap_error(spu); | 275 | __spu_trap_error(spu); |
269 | 276 | ||
270 | spu_int_stat_clear(spu, 0, stat); | ||
271 | spin_unlock_irqrestore(&spu->register_lock, flags); | 277 | spin_unlock_irqrestore(&spu->register_lock, flags); |
272 | 278 | ||
273 | return (stat & 0x7) ? -EIO : 0; | 279 | return (stat & 0x7) ? -EIO : 0; |