Browse Source

powerpc/mm: Fix assert_pte_locked to work properly on uniprocessor

Since the pte_lockptr is a spinlock it gets optimized away on
uniprocessor builds so using spin_is_locked is not correct.  We can use
assert_spin_locked instead and get the proper behavior between UP and
SMP builds.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Kumar Gala 16 years ago
parent
commit
797a747a82
1 changed files with 1 additions and 1 deletions
  1. 1 1
      arch/powerpc/mm/pgtable.c

+ 1 - 1
arch/powerpc/mm/pgtable.c

@@ -254,7 +254,7 @@ void assert_pte_locked(struct mm_struct *mm, unsigned long addr)
 	BUG_ON(pud_none(*pud));
 	BUG_ON(pud_none(*pud));
 	pmd = pmd_offset(pud, addr);
 	pmd = pmd_offset(pud, addr);
 	BUG_ON(!pmd_present(*pmd));
 	BUG_ON(!pmd_present(*pmd));
-	BUG_ON(!spin_is_locked(pte_lockptr(mm, pmd)));
+	assert_spin_locked(pte_lockptr(mm, pmd));
 }
 }
 #endif /* CONFIG_DEBUG_VM */
 #endif /* CONFIG_DEBUG_VM */