summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-09-16 21:57:28 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-09-16 21:57:28 -0700
commit890d643b7f8e337a4fe92e2d5fbb740f4b49e06f (patch)
tree702fd86c1256f5c4171e8c8c44bc5013a795ed5f
parent4289d36eee51a1ccbbab8f84cb8f932b9bdde72c (diff)
[PATCH] ppc64: Fix some bogus warnings & cleanup tlbie code path
This patch fixes some warnings that popped up with the removal of -Wno-uninitialized around the code doing tlbie's. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ppc64/kernel/pSeries_htab.c23
-rw-r--r--arch/ppc64/kernel/pSeries_lpar.c5
2 files changed, 17 insertions, 11 deletions
diff --git a/arch/ppc64/kernel/pSeries_htab.c b/arch/ppc64/kernel/pSeries_htab.c
index dcafb219b5dc..95287d408175 100644
--- a/arch/ppc64/kernel/pSeries_htab.c
+++ b/arch/ppc64/kernel/pSeries_htab.c
@@ -220,10 +220,12 @@ static long pSeries_hpte_updatepp(unsigned long slot, unsigned long newpp,
if ((cur_cpu_spec->cpu_features & CPU_FTR_TLBIEL) && !large && local) {
tlbiel(va);
} else {
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE);
+
+ if (lock_tlbie)
spin_lock(&pSeries_tlbie_lock);
tlbie(va, large);
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_unlock(&pSeries_tlbie_lock);
}
@@ -243,6 +245,7 @@ static void pSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
unsigned long vsid, va, vpn, flags;
long slot;
HPTE *hptep;
+ int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE);
vsid = get_kernel_vsid(ea);
va = (vsid << 28) | (ea & 0x0fffffff);
@@ -256,10 +259,10 @@ static void pSeries_hpte_updateboltedpp(unsigned long newpp, unsigned long ea)
set_pp_bit(newpp, hptep);
/* Ensure it is out of the tlb too */
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_lock_irqsave(&pSeries_tlbie_lock, flags);
tlbie(va, 0);
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_unlock_irqrestore(&pSeries_tlbie_lock, flags);
}
@@ -270,6 +273,7 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
Hpte_dword0 dw0;
unsigned long avpn = va >> 23;
unsigned long flags;
+ int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE);
if (large)
avpn &= ~0x1UL;
@@ -291,10 +295,10 @@ static void pSeries_hpte_invalidate(unsigned long slot, unsigned long va,
if ((cur_cpu_spec->cpu_features & CPU_FTR_TLBIEL) && !large && local) {
tlbiel(va);
} else {
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_lock(&pSeries_tlbie_lock);
tlbie(va, large);
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_unlock(&pSeries_tlbie_lock);
}
local_irq_restore(flags);
@@ -364,8 +368,9 @@ static void pSeries_flush_hash_range(unsigned long context,
asm volatile("ptesync":::"memory");
} else {
- /* XXX double check that it is safe to take this late */
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE);
+
+ if (lock_tlbie)
spin_lock(&pSeries_tlbie_lock);
asm volatile("ptesync":::"memory");
@@ -375,7 +380,7 @@ 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))
+ if (lock_tlbie)
spin_unlock(&pSeries_tlbie_lock);
}
diff --git a/arch/ppc64/kernel/pSeries_lpar.c b/arch/ppc64/kernel/pSeries_lpar.c
index 4124596973b2..b798e94aea6e 100644
--- a/arch/ppc64/kernel/pSeries_lpar.c
+++ b/arch/ppc64/kernel/pSeries_lpar.c
@@ -660,14 +660,15 @@ void pSeries_lpar_flush_hash_range(unsigned long context, unsigned long number,
int i;
unsigned long flags;
struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
+ int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE);
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);
for (i = 0; i < number; i++)
flush_hash_page(context, batch->addr[i], batch->pte[i], local);
- if (!(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE))
+ if (lock_tlbie)
spin_unlock_irqrestore(&pSeries_lpar_tlbie_lock, flags);
}