aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-02-21 05:49:13 -0500
committerPaul Mackerras <paulus@samba.org>2008-02-21 05:49:13 -0500
commita8b87f609d1332216e683b473d33342c86f21ac3 (patch)
tree128f86486e6ec21307c9047949639062da660ad9 /arch/powerpc/platforms
parent9c0338522896c54b79ad7918638175bf58d7c551 (diff)
parent61b36fc1f7d511132b1dd1422c29c7a8f26d77db (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs into merge
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c12
-rw-r--r--arch/powerpc/platforms/cell/spufs/run.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c8
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c6
4 files changed, 7 insertions, 20 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index e45cfa84911f..87eb07f94c5f 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -160,13 +160,6 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea)
160 160
161 pr_debug("%s\n", __FUNCTION__); 161 pr_debug("%s\n", __FUNCTION__);
162 162
163 if (test_bit(SPU_CONTEXT_SWITCH_ACTIVE, &spu->flags)) {
164 /* SLBs are pre-loaded for context switch, so
165 * we should never get here!
166 */
167 printk("%s: invalid access during switch!\n", __func__);
168 return 1;
169 }
170 slb.esid = (ea & ESID_MASK) | SLB_ESID_V; 163 slb.esid = (ea & ESID_MASK) | SLB_ESID_V;
171 164
172 switch(REGION_ID(ea)) { 165 switch(REGION_ID(ea)) {
@@ -226,11 +219,6 @@ static int __spu_trap_data_map(struct spu *spu, unsigned long ea, u64 dsisr)
226 return 0; 219 return 0;
227 } 220 }
228 221
229 if (test_bit(SPU_CONTEXT_SWITCH_ACTIVE, &spu->flags)) {
230 printk("%s: invalid access during switch!\n", __func__);
231 return 1;
232 }
233
234 spu->class_0_pending = 0; 222 spu->class_0_pending = 0;
235 spu->dar = ea; 223 spu->dar = ea;
236 spu->dsisr = dsisr; 224 spu->dsisr = dsisr;
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index fca22e18069a..6221968c2a3c 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -234,6 +234,7 @@ static int spu_run_fini(struct spu_context *ctx, u32 *npc,
234 *npc = ctx->ops->npc_read(ctx); 234 *npc = ctx->ops->npc_read(ctx);
235 235
236 spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED); 236 spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED);
237 ctx->policy = SCHED_IDLE;
237 spu_release(ctx); 238 spu_release(ctx);
238 239
239 if (signal_pending(current)) 240 if (signal_pending(current))
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 5915343e2599..3a5972117de7 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -856,21 +856,18 @@ static noinline void spusched_tick(struct spu_context *ctx)
856{ 856{
857 struct spu_context *new = NULL; 857 struct spu_context *new = NULL;
858 struct spu *spu = NULL; 858 struct spu *spu = NULL;
859 u32 status;
860 859
861 if (spu_acquire(ctx)) 860 if (spu_acquire(ctx))
862 BUG(); /* a kernel thread never has signals pending */ 861 BUG(); /* a kernel thread never has signals pending */
863 862
864 if (ctx->state != SPU_STATE_RUNNABLE) 863 if (ctx->state != SPU_STATE_RUNNABLE)
865 goto out; 864 goto out;
866 if (spu_stopped(ctx, &status))
867 goto out;
868 if (ctx->flags & SPU_CREATE_NOSCHED) 865 if (ctx->flags & SPU_CREATE_NOSCHED)
869 goto out; 866 goto out;
870 if (ctx->policy == SCHED_FIFO) 867 if (ctx->policy == SCHED_FIFO)
871 goto out; 868 goto out;
872 869
873 if (--ctx->time_slice) 870 if (--ctx->time_slice && ctx->policy != SCHED_IDLE)
874 goto out; 871 goto out;
875 872
876 spu = ctx->spu; 873 spu = ctx->spu;
@@ -880,7 +877,8 @@ static noinline void spusched_tick(struct spu_context *ctx)
880 new = grab_runnable_context(ctx->prio + 1, spu->node); 877 new = grab_runnable_context(ctx->prio + 1, spu->node);
881 if (new) { 878 if (new) {
882 spu_unschedule(spu, ctx); 879 spu_unschedule(spu, ctx);
883 spu_add_to_rq(ctx); 880 if (ctx->policy != SCHED_IDLE)
881 spu_add_to_rq(ctx);
884 } else { 882 } else {
885 spu_context_nospu_trace(spusched_tick__newslice, ctx); 883 spu_context_nospu_trace(spusched_tick__newslice, ctx);
886 ctx->time_slice++; 884 ctx->time_slice++;
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 6063c88c26d2..6f5886c7b1f9 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -720,8 +720,9 @@ static inline void set_switch_active(struct spu_state *csa, struct spu *spu)
720 * Restore, Step 23. 720 * Restore, Step 23.
721 * Change the software context switch pending flag 721 * Change the software context switch pending flag
722 * to context switch active. 722 * to context switch active.
723 *
724 * This implementation does not uses a switch active flag.
723 */ 725 */
724 set_bit(SPU_CONTEXT_SWITCH_ACTIVE, &spu->flags);
725 clear_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags); 726 clear_bit(SPU_CONTEXT_SWITCH_PENDING, &spu->flags);
726 mb(); 727 mb();
727} 728}
@@ -1739,9 +1740,8 @@ static inline void reset_switch_active(struct spu_state *csa, struct spu *spu)
1739{ 1740{
1740 /* Restore, Step 74: 1741 /* Restore, Step 74:
1741 * Reset the "context switch active" flag. 1742 * Reset the "context switch active" flag.
1743 * Not performed by this implementation.
1742 */ 1744 */
1743 clear_bit(SPU_CONTEXT_SWITCH_ACTIVE, &spu->flags);
1744 mb();
1745} 1745}
1746 1746
1747static inline void reenable_interrupts(struct spu_state *csa, struct spu *spu) 1747static inline void reenable_interrupts(struct spu_state *csa, struct spu *spu)