From: Arnd Bergmann Date: Wed, 4 Jan 2006 19:31:25 +0000 (+0100) Subject: [PATCH] spufs fix spu_acquire_runnable error path X-Git-Tag: v2.6.16-rc1~666^2~20 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=0106246594a05f02a6be6ee4695c7584c758fa7f;p=linux-2.6-omap-h63xx.git [PATCH] spufs fix spu_acquire_runnable error path 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 Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index c5cd55ac848..336f238102f 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -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 */