aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-02-07 23:02:35 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-07 23:02:35 -0500
commit12e86f92fcfe4f0bcab0ad7fa4088a64c60d9b38 (patch)
tree37321a7dfd382dc2b3325d35af3acf5e9f34d482 /arch/powerpc
parentf03e64f2ca6ee3d0b7824536b1940497701fe766 (diff)
[POWERPC] Only use H_BULK_REMOVE if the firmware supports it
The previous patch changing pSeries to use H_BULK_REMOVE broke the JS20 blade, where the firmware doesn't support H_BULK_REMOVE. This adds a firmware check so that on machines that don't have H_BULK_REMOVE, we just use the H_REMOVE call as before. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/pseries/firmware.c1
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c22
2 files changed, 15 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index 1c7b2baa5f73..90522e3c9d46 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -59,6 +59,7 @@ firmware_features_table[FIRMWARE_MAX_FEATURES] = {
59 {FW_FEATURE_XDABR, "hcall-xdabr"}, 59 {FW_FEATURE_XDABR, "hcall-xdabr"},
60 {FW_FEATURE_MULTITCE, "hcall-multi-tce"}, 60 {FW_FEATURE_MULTITCE, "hcall-multi-tce"},
61 {FW_FEATURE_SPLPAR, "hcall-splpar"}, 61 {FW_FEATURE_SPLPAR, "hcall-splpar"},
62 {FW_FEATURE_BULK_REMOVE, "hcall-bulk"},
62}; 63};
63 64
64/* Build up the firmware features bitmask using the contents of 65/* Build up the firmware features bitmask using the contents of
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 5a684fbd8f27..7496005566ef 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -516,7 +516,7 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
516static void pSeries_lpar_flush_hash_range(unsigned long number, int local) 516static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
517{ 517{
518 unsigned long i, pix, rc; 518 unsigned long i, pix, rc;
519 unsigned long flags; 519 unsigned long flags = 0;
520 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch); 520 struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
521 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE); 521 int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
522 unsigned long param[9]; 522 unsigned long param[9];
@@ -540,16 +540,22 @@ static void pSeries_lpar_flush_hash_range(unsigned long number, int local)
540 hash = ~hash; 540 hash = ~hash;
541 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP; 541 slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
542 slot += hidx & _PTEIDX_GROUP_IX; 542 slot += hidx & _PTEIDX_GROUP_IX;
543 param[pix] = HBR_REQUEST | HBR_AVPN | slot; 543 if (!firmware_has_feature(FW_FEATURE_BULK_REMOVE)) {
544 param[pix+1] = hpte_encode_v(va, psize) & HPTE_V_AVPN; 544 pSeries_lpar_hpte_invalidate(slot, va, psize,
545 pix += 2; 545 local);
546 if (pix == 8) { 546 } else {
547 rc = plpar_hcall9(H_BULK_REMOVE, param, 547 param[pix] = HBR_REQUEST | HBR_AVPN | slot;
548 param[pix+1] = hpte_encode_v(va, psize) &
549 HPTE_V_AVPN;
550 pix += 2;
551 if (pix == 8) {
552 rc = plpar_hcall9(H_BULK_REMOVE, param,
548 param[0], param[1], param[2], 553 param[0], param[1], param[2],
549 param[3], param[4], param[5], 554 param[3], param[4], param[5],
550 param[6], param[7]); 555 param[6], param[7]);
551 BUG_ON(rc != H_SUCCESS); 556 BUG_ON(rc != H_SUCCESS);
552 pix = 0; 557 pix = 0;
558 }
553 } 559 }
554 } pte_iterate_hashed_end(); 560 } pte_iterate_hashed_end();
555 } 561 }