lkml.org 
[lkml]   [2013]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] arm64: allow ioremap_cache() to use existing RAM mappings
From
Date
On Mon, 2013-10-21 at 14:36 +0100, msalter@redhat.com wrote:
> diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
> index 1725cd6..fb44b3d 100644
> --- a/arch/arm64/mm/ioremap.c
> +++ b/arch/arm64/mm/ioremap.c
> @@ -79,6 +79,21 @@ void __iounmap(volatile void __iomem *io_addr)
> {
> void *addr = (void *)(PAGE_MASK & (unsigned long)io_addr);
>
> + /* Nothing to do for normal memory. See ioremap_cache() */
> + if (pfn_valid(__virt_to_phys(addr) >> PAGE_SHIFT))
> + return;

addr here can be some I/O address mapped previously, so __virt_to_phys()
is not valid (you don't actually get the pfn by shifting).

Catalin




\
 
 \ /
  Last update: 2013-10-23 12:01    [W:0.065 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site