Patchwork (no subject)

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

Comments

Andre Detsch - Dec. 10, 2008, 7:03 p.m.
From 8f0016e2ab3bdb4b9f91373b565aadb5c8ab26c9 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 16:03:29 -0300
Subject: [PATCH 10/18] powerpc/spufs: Fix gang->mutex locking at spu_forget
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <200812101703.29965.adetsch@br.ibm.com>

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(-)

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)