Skip to content

Commit

Permalink
[POWERPC] spufs: reacquire LS pointer in spu_process_callback
Browse files Browse the repository at this point in the history
During spu_process callback, we release then acquire the SPU, but keep a
pointer to the local store memory. Since the context may have been
scheduled out during the callback, the ls pointer may become invalid.

This change reacquires the pointer to the context local store after
spu_acquire()-ing, so that it isn't invalidated by a context switch.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
  • Loading branch information
Jeremy Kerr committed Mar 28, 2008
1 parent af8b44e commit 4eb5aef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/powerpc/platforms/cell/spufs/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ static int spu_process_callback(struct spu_context *ctx)
return -EINTR;
}

/* need to re-get the ls, as it may have changed when we released the
* spu */
ls = (void __iomem *)ctx->ops->get_ls(ctx);

/* write result, jump over indirect pointer */
memcpy_toio(ls + ls_pointer, &spu_ret, sizeof(spu_ret));
ctx->ops->npc_write(ctx, npc);
Expand Down

0 comments on commit 4eb5aef

Please sign in to comment.