powerpc: make memremap_compat_align 64s-only
memremap_compat_align is only relevant when ZONE_DEVICE is selected. ZONE_DEVICE depends on ARCH_HAS_PTE_DEVMAP, which is only selected by PPC_BOOK3S_64. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20211201144153.2456614-13-npiggin@gmail.com
This commit is contained in:
parent
ffbe5d21d1
commit
20626177c9
|
@ -129,7 +129,7 @@ config PPC
|
|||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_MEMBARRIER_CALLBACKS
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_MEMREMAP_COMPAT_ALIGN
|
||||
select ARCH_HAS_MEMREMAP_COMPAT_ALIGN if PPC_BOOK3S_64
|
||||
select ARCH_HAS_MMIOWB if PPC64
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PHYS_TO_DMA
|
||||
|
|
|
@ -528,3 +528,23 @@ static int __init pgtable_debugfs_setup(void)
|
|||
return 0;
|
||||
}
|
||||
arch_initcall(pgtable_debugfs_setup);
|
||||
|
||||
#ifdef CONFIG_ZONE_DEVICE
|
||||
/*
|
||||
* Override the generic version in mm/memremap.c.
|
||||
*
|
||||
* With hash translation, the direct-map range is mapped with just one
|
||||
* page size selected by htab_init_page_sizes(). Consult
|
||||
* mmu_psize_defs[] to determine the minimum page size alignment.
|
||||
*/
|
||||
unsigned long memremap_compat_align(void)
|
||||
{
|
||||
if (!radix_enabled()) {
|
||||
unsigned int shift = mmu_psize_defs[mmu_linear_psize].shift;
|
||||
return max(SUBSECTION_SIZE, 1UL << shift);
|
||||
}
|
||||
|
||||
return SUBSECTION_SIZE;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(memremap_compat_align);
|
||||
#endif
|
||||
|
|
|
@ -98,23 +98,3 @@ void __iomem *do_ioremap(phys_addr_t pa, phys_addr_t offset, unsigned long size,
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ZONE_DEVICE
|
||||
/*
|
||||
* Override the generic version in mm/memremap.c.
|
||||
*
|
||||
* With hash translation, the direct-map range is mapped with just one
|
||||
* page size selected by htab_init_page_sizes(). Consult
|
||||
* mmu_psize_defs[] to determine the minimum page size alignment.
|
||||
*/
|
||||
unsigned long memremap_compat_align(void)
|
||||
{
|
||||
unsigned int shift = mmu_psize_defs[mmu_linear_psize].shift;
|
||||
|
||||
if (radix_enabled())
|
||||
return SUBSECTION_SIZE;
|
||||
return max(SUBSECTION_SIZE, 1UL << shift);
|
||||
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(memremap_compat_align);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue