]> err.no Git - linux-2.6/commitdiff
[POWERPC] spufs: reacquire LS pointer in spu_process_callback
authorJeremy Kerr <jk@ozlabs.org>
Tue, 25 Mar 2008 02:32:03 +0000 (13:32 +1100)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 28 Mar 2008 03:36:01 +0000 (14:36 +1100)
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>
arch/powerpc/platforms/cell/spufs/run.c

index cac69e116776bd6bc5e91553057b3f2e4526ac79..2619f14546a3dd620046c2f80a6145c8d89f0bbf 100644 (file)
@@ -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);