[POWERPC] spufs: Don't yield nosched context
authorChristoph Hellwig <hch@lst.de>
Tue, 5 Jun 2007 01:25:59 +0000 (11:25 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 7 Jun 2007 01:44:40 +0000 (11:44 +1000)
Nosched context sould never be scheduled out, thus we must not
deactivate them in spu_yield ever.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spufs/sched.c

index 68fcdc4..3b831e0 100644 (file)
@@ -430,9 +430,11 @@ void spu_deactivate(struct spu_context *ctx)
  */
 void spu_yield(struct spu_context *ctx)
 {
-       mutex_lock(&ctx->state_mutex);
-       __spu_deactivate(ctx, 0, MAX_PRIO);
-       mutex_unlock(&ctx->state_mutex);
+       if (!(ctx->flags & SPU_CREATE_NOSCHED)) {
+               mutex_lock(&ctx->state_mutex);
+               __spu_deactivate(ctx, 0, MAX_PRIO);
+               mutex_unlock(&ctx->state_mutex);
+       }
 }
 
 void spu_sched_tick(struct work_struct *work)