Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs into merge

+17 -9
+8 -7
arch/powerpc/platforms/cell/spufs/run.c
··· 206 206 (SPU_RUNCNTL_RUNNABLE | SPU_RUNCNTL_ISOLATE); 207 207 if (runcntl == 0) 208 208 runcntl = SPU_RUNCNTL_RUNNABLE; 209 - } 210 - 211 - if (ctx->flags & SPU_CREATE_NOSCHED) { 212 - spuctx_switch_state(ctx, SPU_UTIL_USER); 213 - ctx->ops->runcntl_write(ctx, runcntl); 214 209 } else { 215 210 unsigned long privcntl; 216 211 ··· 214 219 else 215 220 privcntl = SPU_PRIVCNTL_MODE_NORMAL; 216 221 217 - ctx->ops->npc_write(ctx, *npc); 218 222 ctx->ops->privcntl_write(ctx, privcntl); 219 - ctx->ops->runcntl_write(ctx, runcntl); 223 + ctx->ops->npc_write(ctx, *npc); 224 + } 225 + 226 + ctx->ops->runcntl_write(ctx, runcntl); 227 + 228 + if (ctx->flags & SPU_CREATE_NOSCHED) { 229 + spuctx_switch_state(ctx, SPU_UTIL_USER); 230 + } else { 220 231 221 232 if (ctx->state == SPU_STATE_SAVED) { 222 233 ret = spu_activate(ctx, 0);
+9 -2
arch/powerpc/platforms/cell/spufs/sched.c
··· 641 641 642 642 if (tmp && tmp->prio > ctx->prio && 643 643 !(tmp->flags & SPU_CREATE_NOSCHED) && 644 - (!victim || tmp->prio > victim->prio)) 644 + (!victim || tmp->prio > victim->prio)) { 645 645 victim = spu->ctx; 646 + get_spu_context(victim); 647 + } 646 648 } 647 649 mutex_unlock(&cbe_spu_info[node].list_mutex); 648 650 ··· 660 658 * look at another context or give up after X retries. 661 659 */ 662 660 if (!mutex_trylock(&victim->state_mutex)) { 661 + put_spu_context(victim); 663 662 victim = NULL; 664 663 goto restart; 665 664 } ··· 673 670 * restart the search. 674 671 */ 675 672 mutex_unlock(&victim->state_mutex); 673 + put_spu_context(victim); 676 674 victim = NULL; 677 675 goto restart; 678 676 } ··· 691 687 spu_add_to_rq(victim); 692 688 693 689 mutex_unlock(&victim->state_mutex); 690 + put_spu_context(victim); 694 691 695 692 return spu; 696 693 } ··· 990 985 struct spu_context *ctx = spu->ctx; 991 986 992 987 if (ctx) { 988 + get_spu_context(ctx); 993 989 mutex_unlock(mtx); 994 990 spusched_tick(ctx); 995 991 mutex_lock(mtx); 992 + put_spu_context(ctx); 996 993 } 997 994 } 998 995 mutex_unlock(mtx); ··· 1037 1030 node = spu->node; 1038 1031 if (old_state == SPU_UTIL_USER) 1039 1032 atomic_dec(&cbe_spu_info[node].busy_spus); 1040 - if (new_state == SPU_UTIL_USER); 1033 + if (new_state == SPU_UTIL_USER) 1041 1034 atomic_inc(&cbe_spu_info[node].busy_spus); 1042 1035 } 1043 1036 }