Skip to content

Commit

Permalink
[POWERPC] spufs: bind_context sets SPU_STATE_RUNNABLE
Browse files Browse the repository at this point in the history
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: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
  • Loading branch information
Christoph Hellwig authored and Arnd Bergmann committed Feb 13, 2007
1 parent aa56c16 commit 81998ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions arch/powerpc/platforms/cell/spufs/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ int spu_acquire_exclusive(struct spu_context *ctx)
ret = spu_activate(ctx, 0);
if (ret)
goto out;
ctx->state = SPU_STATE_RUNNABLE;
} else {
/* We need to exclude userspace access to the context. */
spu_unmap_mappings(ctx);
Expand Down Expand Up @@ -173,7 +172,6 @@ int spu_acquire_runnable(struct spu_context *ctx)
ret = spu_activate(ctx, 0);
if (ret)
goto out;
ctx->state = SPU_STATE_RUNNABLE;
}

downgrade_write(&ctx->state_sema);
Expand Down
2 changes: 2 additions & 0 deletions arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ static inline void bind_context(struct spu *spu, struct spu_context *ctx)
spu->timestamp = jiffies;
spu_cpu_affinity_set(spu, raw_smp_processor_id());
spu_switch_notify(spu, ctx);

ctx->state = SPU_STATE_RUNNABLE;
}

static inline void unbind_context(struct spu *spu, struct spu_context *ctx)
Expand Down

0 comments on commit 81998ba

Please sign in to comment.