Merge branches 'release', 'button-sysfs', 'misc', 'mismatch', 'randconfig' and 'toshi...
[sfrench/cifs-2.6.git] / arch / powerpc / platforms / cell / spufs / sched.c
index 3a5972117de7cdcd04504ae46d97e8b79376e0bc..00528ef84ad2085613703a8feab52a25b1ee9f93 100644 (file)
@@ -246,7 +246,7 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
        spu_switch_notify(spu, ctx);
        ctx->state = SPU_STATE_RUNNABLE;
 
-       spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED);
+       spuctx_switch_state(ctx, SPU_UTIL_USER);
 }
 
 /*
@@ -867,7 +867,7 @@ static noinline void spusched_tick(struct spu_context *ctx)
        if (ctx->policy == SCHED_FIFO)
                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;
 
        spu = ctx->spu;
@@ -877,7 +877,7 @@ static noinline void spusched_tick(struct spu_context *ctx)
        new = grab_runnable_context(ctx->prio + 1, spu->node);
        if (new) {
                spu_unschedule(spu, ctx);
-               if (ctx->policy != SCHED_IDLE)
+               if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags))
                        spu_add_to_rq(ctx);
        } else {
                spu_context_nospu_trace(spusched_tick__newslice, ctx);