powerpc: Fix deadlock in icswx code
commit3493ce844f598f2b732a7e831afb6b1d5be4296f
authorAnton Blanchard <anton@samba.org>
Wed, 14 Sep 2011 09:43:15 +0000 (14 09:43 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:44:42 +0000 (11 09:44 -0800)
tree903fdb0042e188751d4e02f19aeb9940daf12e93
parent85e71ae3431f786adea84c0f879dc02d7474c566
powerpc: Fix deadlock in icswx code

commit 8bdafa39a47265bc029838b35cc6585f69224afa upstream.

The icswx code introduced an A-B B-A deadlock:

     CPU0                    CPU1
     ----                    ----
lock(&anon_vma->mutex);
                             lock(&mm->mmap_sem);
                             lock(&anon_vma->mutex);
lock(&mm->mmap_sem);

Instead of using the mmap_sem to keep mm_users constant, take the
page table spinlock.

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/powerpc/mm/mmu_context_hash64.c