summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorSonny Rao <sonny@burdell.org>2006-06-27 08:46:09 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-29 16:22:46 +1000
commitf86c9747fe1cd72b2c5c6bdf72d17aeb2a3c6cb0 (patch)
treec32ef71ff0e535a467e428d3d874b65232f76708 /arch
parent975b365895b638a62da55f9fb180b0a71d05874d (diff)
downloadop-kernel-dev-f86c9747fe1cd72b2c5c6bdf72d17aeb2a3c6cb0.zip
op-kernel-dev-f86c9747fe1cd72b2c5c6bdf72d17aeb2a3c6cb0.tar.gz
[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 <sonny@burdell.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/mm/mmu_context_64.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/powerpc/mm/mmu_context_64.c b/arch/powerpc/mm/mmu_context_64.c
index 65d18dc..e2051ef 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;
}
OpenPOWER on IntegriCloud