Skip to content

Commit 96e0b35

Browse files
rossstutterheim-garminRussell King (Oracle)
authored andcommitted
ARM: 9447/1: arm/memremap: fix arch_memremap_can_ram_remap()
arm/memremap: fix arch_memremap_can_ram_remap() commit 260364d ("arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map") added the definition of arch_memremap_can_ram_remap() for arm[64] specific filtering of what pages can be used from the linear mapping. memblock_is_map_memory() was called with the pfn of the address given to arch_memremap_can_ram_remap(); however, memblock_is_map_memory() expects to be given an address for arm, not a pfn. This results in calls to memremap() returning a newly mapped area when it should return an address in the existing linear mapping. Fix this by removing the address to pfn translation and pass the address directly. Fixes: 260364d ("arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map") Signed-off-by: Ross Stutterheim <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: [email protected] Reviewed-by: Catalin Marinas <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]>
1 parent 0af2f6b commit 96e0b35

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/arm/mm/ioremap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,5 @@ void __init early_ioremap_init(void)
515515
bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,
516516
unsigned long flags)
517517
{
518-
unsigned long pfn = PHYS_PFN(offset);
519-
520-
return memblock_is_map_memory(pfn);
518+
return memblock_is_map_memory(offset);
521519
}

0 commit comments

Comments
 (0)