From f86c9747fe1cd72b2c5c6bdf72d17aeb2a3c6cb0 Mon Sep 17 00:00:00 2001 From: Sonny Rao Date: Tue, 27 Jun 2006 08:46:09 -0400 Subject: [PATCH] [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 --- arch/powerpc/mm/mmu_context_64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c index 65d18dca26..e2051efa09 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; } -- 2.39.5