[Cbe-oss-dev] [PATCH] spufs: not calling spu_run_init on spu_reacquire_runnable

Andre Detsch adetsch at br.ibm.com
Fri Aug 10 06:11:56 EST 2007


Subject: spufs: not calling spu_run_init on spu_reacquire_runnable

From: Andre Detsch <adetsch at br.ibm.com>

This patch fixes a major bug which was happening when a SPU thread
advances its execution right after being restored to a SPU. A potentially
outdated NPC value was being (re)written to the SPU.

So, spu_run_init, in this case, was either not doing anything relevant,
or breaking the execution of the SPU thread.

This fixes a common problem of losing a mailbox write when it was done
to a saved context.

Signed-off-by: Andre Detsch <adetsch at br.ibm.com>

Index: linux-2.6.22/arch/powerpc/platforms/cell/spufs/run.c
===================================================================
--- linux-2.6.22.orig/arch/powerpc/platforms/cell/spufs/run.c
+++ linux-2.6.22/arch/powerpc/platforms/cell/spufs/run.c
@@ -196,11 +196,7 @@ static int spu_reacquire_runnable(struct
 	if (ret)
 		return ret;
 
-	ret = spu_run_init(ctx, npc);
-	if (ret) {
-		spu_release(ctx);
-		return ret;
-	}
+        spuctx_switch_state(ctx, SPUCTX_UTIL_USER);
 	return 0;
 }
 



More information about the cbe-oss-dev mailing list