This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / arch / ppc64 / kernel / pSeries_htab.c
index dcafb21..8f556f3 100644 (file)
@@ -198,6 +198,7 @@ static long pSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
        HPTE *hptep = htab_data.htab + slot;
        Hpte_dword0 dw0;
        unsigned long avpn = va >> 23;
+       unsigned long flags;
        int ret = 0;
 
        if (large)
@@ -221,10 +222,10 @@ static long pSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
                tlbiel(va);
        } else {
                if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-                       spin_lock(&pSeries_tlbie_lock);
+                       spin_lock_irqsave(&pSeries_tlbie_lock, flags);
                tlbie(va, large);
                if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-                       spin_unlock(&pSeries_tlbie_lock);
+                       spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
        }
 
        return ret;
@@ -274,7 +275,6 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
        if (large)
                avpn &= ~0x1UL;
 
-       local_irq_save(flags);
        pSeries_lock_hpte(hptep);
 
        dw0 = hptep->dw0.dw0;
@@ -292,12 +292,11 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
                tlbiel(va);
        } else {
                if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-                       spin_lock(&pSeries_tlbie_lock);
+                       spin_lock_irqsave(&pSeries_tlbie_lock, flags);
                tlbie(va, large);
                if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-                       spin_unlock(&pSeries_tlbie_lock);
+                       spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
        }
-       local_irq_restore(flags);
 }
 
 static void pSeries_flush_hash_range(unsigned long context,
@@ -312,8 +311,6 @@ static void pSeries_flush_hash_range(unsigned long context,
        /* XXX fix for large ptes */
        unsigned long large = 0;
 
-       local_irq_save(flags);
-
        j = 0;
        for (i = 0; i < number; i++) {
                if ((batch->addr[i] >= USER_START) &&
@@ -366,7 +363,7 @@ static void pSeries_flush_hash_range(unsigned long context,
        } else {
                /* XXX double check that it is safe to take this late */
                if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-                       spin_lock(&pSeries_tlbie_lock);
+                       spin_lock_irqsave(&pSeries_tlbie_lock, flags);
 
                asm volatile("ptesync":::"memory");
 
@@ -376,10 +373,8 @@ static void pSeries_flush_hash_range(unsigned long context,
                asm volatile("eieio; tlbsync; ptesync":::"memory");
 
                if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
-                       spin_unlock(&pSeries_tlbie_lock);
+                       spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
        }
-
-       local_irq_restore(flags);
 }
 
 void hpte_init_pSeries(void)