]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spufs/run.c
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux...
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spufs / run.c
index f7edba6cb795d55944009cc376ff171cdddefa09..c58bd36b0c5b1045c170c7135a2e30f884f204fa 100644 (file)
@@ -206,11 +206,6 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
                        (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE);
                if (runcntl == 0)
                        runcntl = SPU_RUNCNTL_RUNNABLE;
-       }
-
-       if (ctx->flags & SPU_CREATE_NOSCHED) {
-               spuctx_switch_state(ctx, SPU_UTIL_USER);
-               ctx->ops->runcntl_write(ctx, runcntl);
        } else {
                unsigned long privcntl;
 
@@ -219,9 +214,15 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
                else
                        privcntl = SPU_PRIVCNTL_MODE_NORMAL;
 
-               ctx->ops->npc_write(ctx, *npc);
                ctx->ops->privcntl_write(ctx, privcntl);
-               ctx->ops->runcntl_write(ctx, runcntl);
+               ctx->ops->npc_write(ctx, *npc);
+       }
+
+       ctx->ops->runcntl_write(ctx, runcntl);
+
+       if (ctx->flags & SPU_CREATE_NOSCHED) {
+               spuctx_switch_state(ctx, SPU_UTIL_USER);
+       } else {
 
                if (ctx->state == SPU_STATE_SAVED) {
                        ret = spu_activate(ctx, 0);
@@ -248,6 +249,7 @@ static int spu_run_fini(struct spu_context *ctx, u32 *npc,
 
        spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED);
        clear_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags);
+       spu_switch_log_notify(NULL, ctx, SWITCH_LOG_EXIT, *status);
        spu_release(ctx);
 
        if (signal_pending(current))
@@ -416,8 +418,6 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event)
        ret = spu_run_fini(ctx, npc, &status);
        spu_yield(ctx);
 
-       spu_switch_log_notify(NULL, ctx, SWITCH_LOG_EXIT, status);
-
        if ((status & SPU_STATUS_STOPPED_BY_STOP) &&
            (((status >> SPU_STOP_STATUS_SHIFT) & 0x3f00) == 0x2100))
                ctx->stats.libassist++;