[Cbe-oss-dev] [PATCH 10/11] powerpc/spufs: Fix gang->mutex locking in spu_forget

Andre Detsch adetsch at br.ibm.com
Fri Sep 12 09:38:24 EST 2008


gang->mutex was being hold when mmput(ctx->owner) was called.
However, the same lock is taken inside destroy_spu_context, which
was leading to a program hang.

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

diff --git a/arch/powerpc/platforms/cell/spufs/context.c 
b/arch/powerpc/platforms/cell/spufs/context.c
index 7ca787e..9475d1b 100644
--- a/arch/powerpc/platforms/cell/spufs/context.c
+++ b/arch/powerpc/platforms/cell/spufs/context.c
@@ -173,8 +173,8 @@ void spu_forget(struct spu_context *ctx)
 	spu_deactivate(gang);
 	mm = ctx->owner;
 	ctx->owner = NULL;
-	mmput(mm);
 	mutex_unlock(&gang->mutex);
+	mmput(mm);
 }
 
 void spu_unmap_mappings(struct spu_context *ctx)
-- 
1.5.4.1




More information about the cbe-oss-dev mailing list