Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: Fix rare boot build breakage
powerpc/spufs: Fix possible scheduling of a context to multiple SPEs
powerpc/spufs: Fix race for a free SPU
powerpc/spufs: Fix multiple get_spu_context()

+24 -7
+1 -1
arch/powerpc/boot/Makefile
··· 49 49 zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h 50 50 zliblinuxheader := zlib.h zconf.h zutil.h 51 51 52 - $(addprefix $(obj)/,$(zlib) gunzip_util.o main.o): \ 52 + $(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \ 53 53 $(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix $(obj)/,$(zlibheader)) 54 54 55 55 src-libfdt := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
+23 -6
arch/powerpc/platforms/cell/spufs/sched.c
··· 643 643 !(tmp->flags & SPU_CREATE_NOSCHED) && 644 644 (!victim || tmp->prio > victim->prio)) { 645 645 victim = spu->ctx; 646 - get_spu_context(victim); 647 646 } 648 647 } 648 + if (victim) 649 + get_spu_context(victim); 649 650 mutex_unlock(&cbe_spu_info[node].list_mutex); 650 651 651 652 if (victim) { ··· 728 727 /* not a candidate for interruptible because it's called either 729 728 from the scheduler thread or from spu_deactivate */ 730 729 mutex_lock(&ctx->state_mutex); 731 - __spu_schedule(spu, ctx); 730 + if (ctx->state == SPU_STATE_SAVED) 731 + __spu_schedule(spu, ctx); 732 732 spu_release(ctx); 733 733 } 734 734 735 - static void spu_unschedule(struct spu *spu, struct spu_context *ctx) 735 + /** 736 + * spu_unschedule - remove a context from a spu, and possibly release it. 737 + * @spu: The SPU to unschedule from 738 + * @ctx: The context currently scheduled on the SPU 739 + * @free_spu Whether to free the SPU for other contexts 740 + * 741 + * Unbinds the context @ctx from the SPU @spu. If @free_spu is non-zero, the 742 + * SPU is made available for other contexts (ie, may be returned by 743 + * spu_get_idle). If this is zero, the caller is expected to schedule another 744 + * context to this spu. 745 + * 746 + * Should be called with ctx->state_mutex held. 747 + */ 748 + static void spu_unschedule(struct spu *spu, struct spu_context *ctx, 749 + int free_spu) 736 750 { 737 751 int node = spu->node; 738 752 739 753 mutex_lock(&cbe_spu_info[node].list_mutex); 740 754 cbe_spu_info[node].nr_active--; 741 - spu->alloc_state = SPU_FREE; 755 + if (free_spu) 756 + spu->alloc_state = SPU_FREE; 742 757 spu_unbind_context(spu, ctx); 743 758 ctx->stats.invol_ctx_switch++; 744 759 spu->stats.invol_ctx_switch++; ··· 854 837 if (spu) { 855 838 new = grab_runnable_context(max_prio, spu->node); 856 839 if (new || force) { 857 - spu_unschedule(spu, ctx); 840 + spu_unschedule(spu, ctx, new == NULL); 858 841 if (new) { 859 842 if (new->flags & SPU_CREATE_NOSCHED) 860 843 wake_up(&new->stop_wq); ··· 927 910 928 911 new = grab_runnable_context(ctx->prio + 1, spu->node); 929 912 if (new) { 930 - spu_unschedule(spu, ctx); 913 + spu_unschedule(spu, ctx, 0); 931 914 if (test_bit(SPU_SCHED_SPU_RUN, &ctx->sched_flags)) 932 915 spu_add_to_rq(ctx); 933 916 } else {