[Cbe-oss-dev] [PATCH 11:11] spufs: fix missed stop-n-signal event

Luke Browning lukebr at linux.vnet.ibm.com
Fri May 23 06:11:27 EST 2008


Fix missed stop-n-signal event

There is a delay in the transition to the stopped state for class 2
interrupts.  In some cases, the controlling thread detects the state 
of the spu as running.  It goes back to sleep resulting in a hung 
application as the event is missed.  This patch re-generates the
event after a context save.

Signed-off-by: Luke Browning <lukebrowning at us.ibm.com>

---

Index: linux-2.6.25/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- linux-2.6.25.orig/arch/powerpc/platforms/cell/spufs/sched.c
+++ linux-2.6.25/arch/powerpc/platforms/cell/spufs/sched.c
@@ -408,6 +408,8 @@ static int has_affinity(struct spu_conte
  */
 static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
 {
+	u32 status;
+
 	spu_context_trace(spu_unbind_context__enter, ctx, spu);
 
 	BUG_ON(!mutex_is_locked(&ctx->state_mutex));
@@ -457,6 +459,9 @@ static void spu_unbind_context(struct sp
 	/* This maps the underlying spu state to idle */
 	spuctx_switch_state(ctx, SPU_UTIL_IDLE_LOADED);
 	ctx->spu = NULL;
+
+	if (spu_stopped(ctx, &status))
+		wake_up_all(&ctx->stop_wq);
 }
 
 static int spu_on_rq(struct spu_context *ctx)





More information about the cbe-oss-dev mailing list