[POWERPC] spusched: Catch nosched contexts in spu_deactivate
authorChristoph Hellwig <hch@lst.de>
Fri, 29 Jun 2007 00:57:57 +0000 (10:57 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 3 Jul 2007 05:24:45 +0000 (15:24 +1000)
spu_deactivate should never be called for nosched contets.  Put in
a check so we can print a stacktrace and exit early in case it
happes erroneously.

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

index 69272620a6b75e3a46fe644e472009b2cc8c7140..a20e4e28858c514e7dfc76cda2b25703d122afcb 100644 (file)
@@ -491,6 +491,15 @@ static int __spu_deactivate(struct spu_context *ctx, int force, int max_prio)
  */
 void spu_deactivate(struct spu_context *ctx)
 {
+       /*
+        * We must never reach this for a nosched context,
+        * but handle the case gracefull instead of panicing.
+        */
+       if (ctx->flags & SPU_CREATE_NOSCHED) {
+               WARN_ON(1);
+               return;
+       }
+
        __spu_deactivate(ctx, 1, MAX_PRIO);
 }