Loading arch/powerpc/platforms/cell/spufs/context.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -170,7 +170,8 @@ void spu_release_saved(struct spu_context *ctx) { { BUG_ON(ctx->state != SPU_STATE_SAVED); BUG_ON(ctx->state != SPU_STATE_SAVED); if (test_and_clear_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags)) if (test_and_clear_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags) && test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) spu_activate(ctx, 0); spu_activate(ctx, 0); spu_release(ctx); spu_release(ctx); Loading arch/powerpc/platforms/cell/spufs/run.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -220,6 +220,7 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc) } } } } set_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags); return 0; return 0; } } Loading @@ -234,7 +235,7 @@ static int spu_run_fini(struct spu_context *ctx, u32 *npc, *npc = ctx->ops->npc_read(ctx); *npc = ctx->ops->npc_read(ctx); spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); ctx->policy = SCHED_IDLE; clear_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags); spu_release(ctx); spu_release(ctx); if (signal_pending(current)) if (signal_pending(current)) Loading arch/powerpc/platforms/cell/spufs/sched.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -867,7 +867,7 @@ static noinline void spusched_tick(struct spu_context *ctx) if (ctx->policy == SCHED_FIFO) if (ctx->policy == SCHED_FIFO) goto out; goto out; if (--ctx->time_slice && ctx->policy != SCHED_IDLE) if (--ctx->time_slice && test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) goto out; goto out; spu = ctx->spu; spu = ctx->spu; Loading @@ -877,7 +877,7 @@ static noinline void spusched_tick(struct spu_context *ctx) new = grab_runnable_context(ctx->prio + 1, spu->node); new = grab_runnable_context(ctx->prio + 1, spu->node); if (new) { if (new) { spu_unschedule(spu, ctx); spu_unschedule(spu, ctx); if (ctx->policy != SCHED_IDLE) if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) spu_add_to_rq(ctx); spu_add_to_rq(ctx); } else { } else { spu_context_nospu_trace(spusched_tick__newslice, ctx); spu_context_nospu_trace(spusched_tick__newslice, ctx); Loading arch/powerpc/platforms/cell/spufs/spufs.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,7 @@ struct spu_gang; enum { enum { SPU_SCHED_NOTIFY_ACTIVE, SPU_SCHED_NOTIFY_ACTIVE, SPU_SCHED_WAS_ACTIVE, /* was active upon spu_acquire_saved() */ SPU_SCHED_WAS_ACTIVE, /* was active upon spu_acquire_saved() */ SPU_SCHED_SPU_RUN, /* context is within spu_run */ }; }; struct spu_context { struct spu_context { Loading Loading
arch/powerpc/platforms/cell/spufs/context.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -170,7 +170,8 @@ void spu_release_saved(struct spu_context *ctx) { { BUG_ON(ctx->state != SPU_STATE_SAVED); BUG_ON(ctx->state != SPU_STATE_SAVED); if (test_and_clear_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags)) if (test_and_clear_bit(SPU_SCHED_WAS_ACTIVE, &ctx->sched_flags) && test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) spu_activate(ctx, 0); spu_activate(ctx, 0); spu_release(ctx); spu_release(ctx); Loading
arch/powerpc/platforms/cell/spufs/run.c +2 −1 Original line number Original line Diff line number Diff line Loading @@ -220,6 +220,7 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc) } } } } set_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags); return 0; return 0; } } Loading @@ -234,7 +235,7 @@ static int spu_run_fini(struct spu_context *ctx, u32 *npc, *npc = ctx->ops->npc_read(ctx); *npc = ctx->ops->npc_read(ctx); spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); ctx->policy = SCHED_IDLE; clear_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags); spu_release(ctx); spu_release(ctx); if (signal_pending(current)) if (signal_pending(current)) Loading
arch/powerpc/platforms/cell/spufs/sched.c +2 −2 Original line number Original line Diff line number Diff line Loading @@ -867,7 +867,7 @@ static noinline void spusched_tick(struct spu_context *ctx) if (ctx->policy == SCHED_FIFO) if (ctx->policy == SCHED_FIFO) goto out; goto out; if (--ctx->time_slice && ctx->policy != SCHED_IDLE) if (--ctx->time_slice && test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) goto out; goto out; spu = ctx->spu; spu = ctx->spu; Loading @@ -877,7 +877,7 @@ static noinline void spusched_tick(struct spu_context *ctx) new = grab_runnable_context(ctx->prio + 1, spu->node); new = grab_runnable_context(ctx->prio + 1, spu->node); if (new) { if (new) { spu_unschedule(spu, ctx); spu_unschedule(spu, ctx); if (ctx->policy != SCHED_IDLE) if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) spu_add_to_rq(ctx); spu_add_to_rq(ctx); } else { } else { spu_context_nospu_trace(spusched_tick__newslice, ctx); spu_context_nospu_trace(spusched_tick__newslice, ctx); Loading
arch/powerpc/platforms/cell/spufs/spufs.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,7 @@ struct spu_gang; enum { enum { SPU_SCHED_NOTIFY_ACTIVE, SPU_SCHED_NOTIFY_ACTIVE, SPU_SCHED_WAS_ACTIVE, /* was active upon spu_acquire_saved() */ SPU_SCHED_WAS_ACTIVE, /* was active upon spu_acquire_saved() */ SPU_SCHED_SPU_RUN, /* context is within spu_run */ }; }; struct spu_context { struct spu_context { Loading