]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/platforms/cell/spufs/context.c
[POWERPC] spufs: add context switch notification log
[linux-2.6-omap-h63xx.git] / arch / powerpc / platforms / cell / spufs / context.c
index cf6c2c89211d2dc2fe308e50404370d3ae9af418..91f2d4d9aefd71eb2ab08cf113857f4c424dace2 100644 (file)
@@ -88,6 +88,7 @@ void destroy_spu_context(struct kref *kref)
                kref_put(ctx->prof_priv_kref, ctx->prof_priv_release);
        BUG_ON(!list_empty(&ctx->rq));
        atomic_dec(&nr_spu_contexts);
+       kfree(ctx->switch_log);
        kfree(ctx);
 }
 
@@ -170,7 +171,8 @@ void spu_release_saved(struct spu_context *ctx)
 {
        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_release(ctx);