summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/pgtable_64.c
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2018-10-09 16:51:43 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2018-10-14 10:04:09 +0300
commit56f3c1413f5cce0c8f4d6f1ab79d790da5aa61af (patch)
treea1ec8ea4a338d63d56353383ae49caad7b5b23dc /arch/powerpc/mm/pgtable_64.c
parentaa91796ec46339f2ed53da311bd3ea77a3e4dfe1 (diff)
downloadlinux-56f3c1413f5cce0c8f4d6f1ab79d790da5aa61af.tar.xz
powerpc/mm: properly set PAGE_KERNEL flags in ioremap()
Set PAGE_KERNEL directly in the caller and do not rely on a hack adding PAGE_KERNEL flags when _PAGE_PRESENT is not set. As already done for PPC64, use pgprot_cache() helpers instead of _PAGE_XXX flags in PPC32 ioremap() derived functions. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/mm/pgtable_64.c')
-rw-r--r--arch/powerpc/mm/pgtable_64.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
index c0f356d9b135..1f1bb40555a8 100644
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -118,10 +118,6 @@ void __iomem * __ioremap_at(phys_addr_t pa, void *ea, unsigned long size,
{
unsigned long i;
- /* Make sure we have the base flags */
- if ((flags & _PAGE_PRESENT) == 0)
- flags |= pgprot_val(PAGE_KERNEL);
-
/* We don't support the 4K PFN hack with ioremap */
if (flags & H_PAGE_4K_PFN)
return NULL;
@@ -204,7 +200,7 @@ void __iomem * __ioremap(phys_addr_t addr, unsigned long size,
void __iomem * ioremap(phys_addr_t addr, unsigned long size)
{
- unsigned long flags = pgprot_val(pgprot_noncached(__pgprot(0)));
+ unsigned long flags = pgprot_val(pgprot_noncached(PAGE_KERNEL));
void *caller = __builtin_return_address(0);
if (ppc_md.ioremap)
@@ -214,7 +210,7 @@ void __iomem * ioremap(phys_addr_t addr, unsigned long size)
void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
{
- unsigned long flags = pgprot_val(pgprot_noncached_wc(__pgprot(0)));
+ unsigned long flags = pgprot_val(pgprot_noncached_wc(PAGE_KERNEL));
void *caller = __builtin_return_address(0);
if (ppc_md.ioremap)
@@ -224,7 +220,7 @@ void __iomem * ioremap_wc(phys_addr_t addr, unsigned long size)
void __iomem *ioremap_coherent(phys_addr_t addr, unsigned long size)
{
- unsigned long flags = pgprot_val(pgprot_cached(__pgprot(0)));
+ unsigned long flags = pgprot_val(pgprot_cached(PAGE_KERNEL));
void *caller = __builtin_return_address(0);
if (ppc_md.ioremap)