[PATCH] powerpc64: fix spinlock recursion in native_hpte_clear
authorR Sharada <sharada@in.ibm.com>
Wed, 22 Feb 2006 16:13:08 +0000 (21:43 +0530)
committerPaul Mackerras <paulus@samba.org>
Fri, 24 Feb 2006 00:36:29 +0000 (11:36 +1100)
native_hpte_clear has a spinlock recursion problem with the native_tlbie_lock
being called twice, once in native_hpte_clear() and once within tlbie().
Fix the problem by changing the call to tlbie() in native_hpte_clear() to
__tlbie(). It still supports only 4k pages for now.

Signed-off-by: R Sharada <sharada@in.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/mm/hash_native_64.c

index d96bcfe4c6f6c2ed38f6c55afeb7e7809c6bd37c..33654d1b1b43b596ac70e98cf834a1185157f355 100644 (file)
@@ -403,12 +403,17 @@ static void native_hpte_clear(void)
                 */
                hpte_v = hptep->v;
 
+               /*
+                * Call __tlbie() here rather than tlbie() since we
+                * already hold the native_tlbie_lock.
+                */
                if (hpte_v & HPTE_V_VALID) {
                        hptep->v = 0;
-                       tlbie(slot2va(hpte_v, slot), MMU_PAGE_4K, 0);
+                       __tlbie(slot2va(hpte_v, slot), MMU_PAGE_4K);
                }
        }
 
+       asm volatile("eieio; tlbsync; ptesync":::"memory");
        spin_unlock(&native_tlbie_lock);
        local_irq_restore(flags);
 }