Only bind_context/unbind_context change the spu context state.  Thus
we can move all assignents of SPU_STATE_RUNNABLE into bind_context,
which parallels the unbind side aswell.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
                ret = spu_activate(ctx, 0);
                if (ret)
                        goto out;
-               ctx->state = SPU_STATE_RUNNABLE;
        } else {
                /* We need to exclude userspace access to the context. */
                spu_unmap_mappings(ctx);
                ret = spu_activate(ctx, 0);
                if (ret)
                        goto out;
-               ctx->state = SPU_STATE_RUNNABLE;
        }
 
        downgrade_write(&ctx->state_sema);
 
        spu->timestamp = jiffies;
        spu_cpu_affinity_set(spu, raw_smp_processor_id());
        spu_switch_notify(spu, ctx);
+
+       ctx->state = SPU_STATE_RUNNABLE;
 }
 
 static inline void unbind_context(struct spu *spu, struct spu_context *ctx)