LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@ozlabs.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
Subject: [PATCH 4/4] spufs: fix timing dependent false return from spufs_run_spu
Date: Fri, 08 Feb 2008 15:50:41 +1100	[thread overview]
Message-ID: <1202446241.802632.835156785521.4.gpush@pokey> (raw)
In-Reply-To: <1202446241.799868.442184577655.0.gpush@pokey>

From: Luke Browning <lukebr@linux.vnet.ibm.com>

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>

---
 arch/powerpc/platforms/cell/spufs/run.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c
index f401e51..fca22e1 100644
--- a/arch/powerpc/platforms/cell/spufs/run.c
+++ b/arch/powerpc/platforms/cell/spufs/run.c
@@ -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;

  parent reply	other threads:[~2008-02-08  4:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-08  4:50 [PATCH 0/4] A few spufs fixes for .25 Jeremy Kerr
2008-02-08  4:50 ` [PATCH 1/4] spufs: fix state_mutex leaks Jeremy Kerr
2008-02-08  4:50 ` [PATCH 2/4] spufs: update SPU_Status[CISHP] in backing runcntl write Jeremy Kerr
2008-02-08  4:50 ` Jeremy Kerr [this message]
2008-02-08  4:50 ` [PATCH 3/4] spufs: no need to have a runnable SPU for libassist update Jeremy Kerr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1202446241.802632.835156785521.4.gpush@pokey \
    --to=jk@ozlabs.org \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox