Patchwork [16/18] powerpc/spufs: Fix double lock on cbe_spu_info[node].list_mutex

login
register
mail settings
Submitter Andre Detsch
Date Dec. 10, 2008, 7:40 p.m.
Message ID <200812101740.43971.adetsch@br.ibm.com>
Download mbox | patch
Permalink /patch/13310/
State RFC
Headers show

Comments

Andre Detsch - Dec. 10, 2008, 7:40 p.m.
put_spu_context cannot be called with the cbe_spu_info[].list_mutex
spin_lock being hold.

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

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 7b4852f..3163239 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1293,8 +1293,8 @@  static int spusched_thread(void *unused)
 					mutex_unlock(mtx);
 					preempted += spusched_tick(gang, ctx,
 						preempted < maxcontexts);
-					mutex_lock(mtx);
 					put_spu_context(ctx);
+					mutex_lock(mtx);
 					active++;
 				}
 			}