Patchwork (no subject)

login
register
mail settings
Submitter Andre Detsch
Date Dec. 10, 2008, 7:04 p.m.
Message ID <200812101904.mBAJ4aqb025955@d24av02.br.ibm.com>
Download mbox | patch
Permalink /patch/13298/
State Superseded
Headers show

Comments

Andre Detsch - Dec. 10, 2008, 7:04 p.m.
From 79bfac76852a4ab391470803ef2804c403309472 Mon Sep 17 00:00:00 2001
In-Reply-To: <200812101654.05091.adetsch@br.ibm.com>
References: <200812101654.05091.adetsch@br.ibm.com>
From: Andre Detsch <adetsch@br.ibm.com>
Date: Wed, 10 Dec 2008 17:04:37 -0200
Subject: [PATCH 18/18] powerpc/spufs: Hold list_mutex while performing a context unbind.
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200812101704.37435.adetsch@br.ibm.com>

Also, add a related BUG_ON.

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

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 3163239..ce110ad 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -566,8 +566,8 @@  static void spu_unschedule(struct spu_gang *gang)
 		BUG_ON(spu->gang != gang);
 		BUG_ON(spu->alloc_state != SPU_USED);
 		node = spu->node;
-		spu_unbind_context(spu, ctx);
 		mutex_lock(&cbe_spu_info[node].list_mutex);
+		spu_unbind_context(spu, ctx);
 		cbe_spu_info[node].nr_active--;
 		spu->alloc_state = SPU_FREE;
 		spu->ctx = NULL;
@@ -1289,6 +1289,7 @@  static int spusched_thread(void *unused)
 					gang = spu->gang;
 					BUG_ON(!gang);
 					ctx = spu->ctx;
+					BUG_ON(!ctx);
 					get_spu_context(ctx);
 					mutex_unlock(mtx);
 					preempted += spusched_tick(gang, ctx,