[Cbe-oss-dev] (no subject)

adetsch at br.ibm.com adetsch at br.ibm.com
Thu Dec 11 06:04:25 EST 2008


>From cc28e8a5739924621833e2750af163d336a3e0a3 Mon Sep 17 00:00:00 2001
In-Reply-To: <200812101654.05091.adetsch at br.ibm.com>
References: <200812101654.05091.adetsch at br.ibm.com>
From: Andre Detsch <adetsch at br.ibm.com>
Date: Wed, 10 Dec 2008 17:04:25 -0200
Subject: [PATCH 15/18] powerpc/spufs: Fix position of BUG_ON inside spusched_tick
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200812101704.25515.adetsch at br.ibm.com>

The old position of the BUG_ON(!spu_gang_runnable(gang))
command was leading to false bug notifications.
The gang might become not runnable when spusched_tick is
about to be called, as there is no lock being hold that
prevents this to happen. It only is a bug if ctx->spu
was not unset during the process.

Signed-off-by: Andre Detsch <adetsch at br.ibm.com>
---
 arch/powerpc/platforms/cell/spufs/sched.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index be13b19..7b4852f 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1160,11 +1160,11 @@ static noinline int spusched_tick(struct spu_gang *gang,
 
 	mutex_lock(&gang->mutex);
 
-	BUG_ON(!spu_gang_runnable(gang));
-
 	if (!ctx->spu)
 		goto out;
 
+	BUG_ON(!spu_gang_runnable(gang));
+
 	if (ctx->flags & SPU_CREATE_NOSCHED)
 		goto out;
 
-- 
1.5.4.3




More information about the cbe-oss-dev mailing list