aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-03-10 21:46:18 -0400
committerJeremy Kerr <jk@ozlabs.org>2008-03-10 21:46:18 -0400
commitc368392a9951e6e25e2e2f9268153f1e9365e2c2 (patch)
treed00ec74a057bbc9ab251c6a8c47787c757cc9340
parentce7c191bca88aa2f942f70a6d6c6315739a81a32 (diff)
[POWERPC] spufs: fix rescheduling of non-runnable contexts
At present, we can hit the BUG_ON in __spu_update_sched_info by reading the regs file of a context between two calls to spu_run. The spu_release_saved called by spufs_regs_read() is resulting in the (now non-runnable) context being placed back on the run queue, so the next call to spu_run ends up in the bug condition. This change uses the SPU_SCHED_SPU_RUN flag to only reschedule a context if it's still in spu_run(). Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--arch/powerpc/platforms/cell/spufs/context.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index cf6c2c89211d..0ad83aeb70b1 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -170,7 +170,8 @@ void spu_release_saved(struct spu_context *ctx)
170{ 170{
171 BUG_ON(ctx->state != SPU_STATE_SAVED); 171 BUG_ON(ctx->state != SPU_STATE_SAVED);
172 172
173 if (test_and_clear_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags)) 173 if (test_and_clear_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags) &&
174 test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
174 spu_activate(ctx, 0); 175 spu_activate(ctx, 0);
175 176
176 spu_release(ctx); 177 spu_release(ctx);