aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-04-01 09:46:05 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-30 18:25:16 -0400
commit9048e648bc22d7b59093f8ca1978c5767893aaa5 (patch)
tree7a1849a64a5d91111726fc66041852913ed3493c
parent00f554fadebb96877ad449758dc90303a9826afe (diff)
powerpc: Use 64k io pages when we never see an HEA
When we never get around to seeing an HEA ethernet adapter, there's no point in restricting ourselves to 4k IO page size. This speeds up IO maps when CONFIG_IBMEBUS is disabled. [ Updated the test to also lift the restriction on arch 2.07 (Power 8) which cannot have an HEA -- BenH ] Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> foo
-rw-r--r--arch/powerpc/mm/hash_utils_64.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index d766d6ee33fe..12f1a397f502 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -445,6 +445,24 @@ static void mmu_psize_set_default_penc(void)
445 mmu_psize_defs[bpsize].penc[apsize] = -1; 445 mmu_psize_defs[bpsize].penc[apsize] = -1;
446} 446}
447 447
448#ifdef CONFIG_PPC_64K_PAGES
449
450static bool might_have_hea(void)
451{
452 /*
453 * The HEA ethernet adapter requires awareness of the
454 * GX bus. Without that awareness we can easily assume
455 * we will never see an HEA ethernet device.
456 */
457#ifdef CONFIG_IBMEBUS
458 return !cpu_has_feature(CPU_FTR_ARCH_207S);
459#else
460 return false;
461#endif
462}
463
464#endif /* #ifdef CONFIG_PPC_64K_PAGES */
465
448static void __init htab_init_page_sizes(void) 466static void __init htab_init_page_sizes(void)
449{ 467{
450 int rc; 468 int rc;
@@ -499,10 +517,11 @@ static void __init htab_init_page_sizes(void)
499 mmu_linear_psize = MMU_PAGE_64K; 517 mmu_linear_psize = MMU_PAGE_64K;
500 if (mmu_has_feature(MMU_FTR_CI_LARGE_PAGE)) { 518 if (mmu_has_feature(MMU_FTR_CI_LARGE_PAGE)) {
501 /* 519 /*
502 * Don't use 64k pages for ioremap on pSeries, since 520 * When running on pSeries using 64k pages for ioremap
503 * that would stop us accessing the HEA ethernet. 521 * would stop us accessing the HEA ethernet. So if we
522 * have the chance of ever seeing one, stay at 4k.
504 */ 523 */
505 if (!machine_is(pseries)) 524 if (!might_have_hea() || !machine_is(pseries))
506 mmu_io_psize = MMU_PAGE_64K; 525 mmu_io_psize = MMU_PAGE_64K;
507 } else 526 } else
508 mmu_ci_restrictions = 1; 527 mmu_ci_restrictions = 1;