diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-11 06:02:59 (GMT) |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-11 06:02:59 (GMT) |
commit | efb3e34b6176d30c4fe8635fa8e1beb6280cc2cd (patch) | |
tree | e5ed3fee988e3816a9f4ea47bf83970a010cb83e /arch/sh/include/asm/io.h | |
parent | 11e1ed6e88616be5489a43bc6297d9bb8464908b (diff) | |
download | linux-efb3e34b6176d30c4fe8635fa8e1beb6280cc2cd.tar.xz |
sh: Fix up legacy PTEA space attribute mapping.
When p3_ioremap() was converted to ioremap_prot() there was some breakage
introduced where the 29-bit segmentation logic would trap the area range
and return an identity mapping without having allowed the area
specification to force mapping through page tables. This wires up a PCC
mask for pgprot verification to work out whether to short-circuit the
identity mapping on legacy parts, restoring the previous behaviour.
Reported-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: stable@kernel.org
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/io.h')
-rw-r--r-- | arch/sh/include/asm/io.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 70c1186..28c5aa5 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -290,7 +290,15 @@ __ioremap_29bit(phys_addr_t offset, unsigned long size, pgprot_t prot) * mapping must be done by the PMB or by using page tables. */ if (likely(PXSEG(offset) < P3SEG && PXSEG(last_addr) < P3SEG)) { - if (unlikely(pgprot_val(prot) & _PAGE_CACHABLE)) + u64 flags = pgprot_val(prot); + + /* + * Anything using the legacy PTEA space attributes needs + * to be kicked down to page table mappings. + */ + if (unlikely(flags & _PAGE_PCC_MASK)) + return NULL; + if (unlikely(flags & _PAGE_CACHABLE)) return (void __iomem *)P1SEGADDR(offset); return (void __iomem *)P2SEGADDR(offset); |