From: Sonny Rao Date: Tue, 27 Jun 2006 12:46:09 +0000 (-0400) Subject: [POWERPC] Fix idr locking in init_new_context X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f86c9747fe1cd72b2c5c6bdf72d17aeb2a3c6cb0;p=mv-sheeva.git [POWERPC] Fix idr locking in init_new_context We always need to serialize accesses to mmu_context_idr. I hit this bug when testing with a small number of mmu contexts. Signed-off-by: Sonny Rao Signed-off-by: Paul Mackerras --- diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c index 65d18dca266..e2051efa09c 100644 --- a/arch/powerpc/mm/mmu_context_64.c +++ b/arch/powerpc/mm/mmu_context_64.c @@ -44,7 +44,9 @@ again: return err; if (index > MAX_CONTEXT) { + spin_lock(&mmu_context_lock); idr_remove(&mmu_context_idr, index); + spin_unlock(&mmu_context_lock); return -ENOMEM; }