/* Check if there is a higher priority context waiting and if yes unbind @ctx from the physical spu and schedule the highest priority context to run on the freed physical spu instead.  */
void spu_yield(struct spu_context *ctx)
/* Check if there is a higher priority context waiting and if yes unbind @ctx from the physical spu and schedule the highest priority context to run on the freed physical spu instead.  */
void spu_yield(struct spu_context *ctx)
{
	spu_context_nospu_trace(spu_yield__enter, ctx);
	if (!(ctx->flags & SPU_CREATE_NOSCHED)) {
		mutex_lock(&ctx->state_mutex);
		__spu_deactivate(ctx, 0, MAX_PRIO);
		mutex_unlock(&ctx->state_mutex);
	}
}