Commit 81998baf authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Arnd Bergmann

[POWERPC] spufs: bind_context sets SPU_STATE_RUNNABLE

Only bind_context/unbind_context change the spu context state.  Thus
we can move all assignents of SPU_STATE_RUNNABLE into bind_context,
which parallels the unbind side aswell.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
parent aa56c168
...@@ -139,7 +139,6 @@ int spu_acquire_exclusive(struct spu_context *ctx) ...@@ -139,7 +139,6 @@ int spu_acquire_exclusive(struct spu_context *ctx)
ret = spu_activate(ctx, 0); ret = spu_activate(ctx, 0);
if (ret) if (ret)
goto out; goto out;
ctx->state = SPU_STATE_RUNNABLE;
} else { } else {
/* We need to exclude userspace access to the context. */ /* We need to exclude userspace access to the context. */
spu_unmap_mappings(ctx); spu_unmap_mappings(ctx);
...@@ -173,7 +172,6 @@ int spu_acquire_runnable(struct spu_context *ctx) ...@@ -173,7 +172,6 @@ int spu_acquire_runnable(struct spu_context *ctx)
ret = spu_activate(ctx, 0); ret = spu_activate(ctx, 0);
if (ret) if (ret)
goto out; goto out;
ctx->state = SPU_STATE_RUNNABLE;
} }
downgrade_write(&ctx->state_sema); downgrade_write(&ctx->state_sema);
......
...@@ -118,6 +118,8 @@ static inline void bind_context(struct spu *spu, struct spu_context *ctx) ...@@ -118,6 +118,8 @@ static inline void bind_context(struct spu *spu, struct spu_context *ctx)
spu->timestamp = jiffies; spu->timestamp = jiffies;
spu_cpu_affinity_set(spu, raw_smp_processor_id()); spu_cpu_affinity_set(spu, raw_smp_processor_id());
spu_switch_notify(spu, ctx); spu_switch_notify(spu, ctx);
ctx->state = SPU_STATE_RUNNABLE;
} }
static inline void unbind_context(struct spu *spu, struct spu_context *ctx) static inline void unbind_context(struct spu *spu, struct spu_context *ctx)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment