Skip to content

Commit

Permalink
[POWERPC] spufs: Fix timing dependent false return from spufs_run_spu
Browse files Browse the repository at this point in the history
Stop bits are only valid when the running bit is not set.  Status bits
carry over from one invocation of spufs_run_spu() to another, so the
RUNNING bit gets added to the previous state of the register which may
have been a remote library call.  In this case, it looks like another
library routine should be invoked, but the spe is actually running.

This fixes a problem with a testcase that exercises the scheduler.

Signed-off-by: Luke Browning <lukebrowning@us.ibm.com>
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Luke Browning authored and Paul Mackerras committed Feb 8, 2008
1 parent e66686b commit 85687ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spufs/run.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ int spu_stopped(struct spu_context *ctx, u32 *stat)

stopped = SPU_STATUS_INVALID_INSTR | SPU_STATUS_SINGLE_STEP |
SPU_STATUS_STOPPED_BY_HALT | SPU_STATUS_STOPPED_BY_STOP;
if (*stat & stopped)
if (!(*stat & SPU_STATUS_RUNNING) && (*stat & stopped))
return 1;

dsisr = ctx->csa.dsisr;
Expand Down

0 comments on commit 85687ff

Please sign in to comment.