aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--include/asm-powerpc/spu.h3
5 files changed, 8 insertions, 22 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index e45cfa84911..87eb07f94c5 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 fca22e18069..6221968c2a3 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 5915343e259..3a5972117de 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 6063c88c26d..6f5886c7b1f 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)
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index f07c99ba5d1..e3c845b0f76 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -98,9 +98,8 @@
98#define MFC_PRIV_ATTN_EVENT 0x00000800 98#define MFC_PRIV_ATTN_EVENT 0x00000800
99#define MFC_MULTI_SRC_EVENT 0x00001000 99#define MFC_MULTI_SRC_EVENT 0x00001000
100 100
101/* Flags indicating progress during context switch. */ 101/* Flag indicating progress during context switch. */
102#define SPU_CONTEXT_SWITCH_PENDING 0UL 102#define SPU_CONTEXT_SWITCH_PENDING 0UL
103#define SPU_CONTEXT_SWITCH_ACTIVE 1UL
104 103
105struct spu_context; 104struct spu_context;
106struct spu_runqueue; 105struct spu_runqueue;