diff options
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/run.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 8 |
2 files changed, 4 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index fca22e18069a..6221968c2a3c 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
@@ -234,6 +234,7 @@ static int spu_run_fini(struct spu_context *ctx, u32 *npc, | |||
234 | *npc = ctx->ops->npc_read(ctx); | 234 | *npc = ctx->ops->npc_read(ctx); |
235 | 235 | ||
236 | spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); | 236 | spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); |
237 | ctx->policy = SCHED_IDLE; | ||
237 | spu_release(ctx); | 238 | spu_release(ctx); |
238 | 239 | ||
239 | if (signal_pending(current)) | 240 | if (signal_pending(current)) |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 5915343e2599..3a5972117de7 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -856,21 +856,18 @@ static noinline void spusched_tick(struct spu_context *ctx) | |||
856 | { | 856 | { |
857 | struct spu_context *new = NULL; | 857 | struct spu_context *new = NULL; |
858 | struct spu *spu = NULL; | 858 | struct spu *spu = NULL; |
859 | u32 status; | ||
860 | 859 | ||
861 | if (spu_acquire(ctx)) | 860 | if (spu_acquire(ctx)) |
862 | BUG(); /* a kernel thread never has signals pending */ | 861 | BUG(); /* a kernel thread never has signals pending */ |
863 | 862 | ||
864 | if (ctx->state != SPU_STATE_RUNNABLE) | 863 | if (ctx->state != SPU_STATE_RUNNABLE) |
865 | goto out; | 864 | goto out; |
866 | if (spu_stopped(ctx, &status)) | ||
867 | goto out; | ||
868 | if (ctx->flags & SPU_CREATE_NOSCHED) | 865 | if (ctx->flags & SPU_CREATE_NOSCHED) |
869 | goto out; | 866 | goto out; |
870 | if (ctx->policy == SCHED_FIFO) | 867 | if (ctx->policy == SCHED_FIFO) |
871 | goto out; | 868 | goto out; |
872 | 869 | ||
873 | if (--ctx->time_slice) | 870 | if (--ctx->time_slice && ctx->policy != SCHED_IDLE) |
874 | goto out; | 871 | goto out; |
875 | 872 | ||
876 | spu = ctx->spu; | 873 | spu = ctx->spu; |
@@ -880,7 +877,8 @@ static noinline void spusched_tick(struct spu_context *ctx) | |||
880 | new = grab_runnable_context(ctx->prio + 1, spu->node); | 877 | new = grab_runnable_context(ctx->prio + 1, spu->node); |
881 | if (new) { | 878 | if (new) { |
882 | spu_unschedule(spu, ctx); | 879 | spu_unschedule(spu, ctx); |
883 | spu_add_to_rq(ctx); | 880 | if (ctx->policy != SCHED_IDLE) |
881 | spu_add_to_rq(ctx); | ||
884 | } else { | 882 | } else { |
885 | spu_context_nospu_trace(spusched_tick__newslice, ctx); | 883 | spu_context_nospu_trace(spusched_tick__newslice, ctx); |
886 | ctx->time_slice++; | 884 | ctx->time_slice++; |