[PATCH] spufs fix spu_acquire_runnable error path
authorArnd Bergmann <arnd@arndb.de>
Wed, 4 Jan 2006 19:31:25 +0000 (20:31 +0100)
committerPaul Mackerras <paulus@samba.org>
Mon, 9 Jan 2006 04:44:40 +0000 (15:44 +1100)
When spu_activate fails in spu_acquire_runnable, the
state must still be SPU_STATE_SAVED, we were
incorrectly setting it to SPU_STATE_RUNNABLE.

Signed-off-by: Arnd Bergmann <arndb@de.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/platforms/cell/spufs/context.c

index c5cd55ac848d2774375d1816f7df4cc1671e2872..336f238102fd383262623b07b467f895a8f61939 100644 (file)
@@ -132,10 +132,10 @@ int spu_acquire_runnable(struct spu_context *ctx)
 
        if (ctx->state == SPU_STATE_SAVED) {
                ret = spu_activate(ctx, 0);
+               if (ret)
+                       goto out;
                ctx->state = SPU_STATE_RUNNABLE;
        }
-       if (ret)
-               goto out;
 
        downgrade_write(&ctx->state_sema);
        /* On success, we return holding the lock */