diff mbox

[10/18] powerpc/spufs: Fix gang->mutex locking at spu_forget

Message ID 200812101740.49877.adetsch@br.ibm.com
State RFC
Headers show

Commit Message

Andre Detsch Dec. 10, 2008, 7:40 p.m. UTC
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@br.ibm.com>
---
 arch/powerpc/platforms/cell/spufs/context.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c
index f48bcdd..11b9237 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)