Skip to contentSkip to conversation

powerpc: fix idr locking in init_new_context

PATCH New Sonny Rao 1 participant 1 message Jun 27, 2006 PowerPC

lore
Share & tools
lore

Sonny Rao

author
#0 lore raw

PATCH 1/1 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.

arch/powerpc/mm/mmu_context_64.c +2 -0
@@ -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;
        }