summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRoss Stutterheim <ross.stutterheim@garmin.com>2025-04-16 14:50:06 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-27 11:07:28 +0100
commit29539db4287ddcc382565531341eae92cb107110 (patch)
tree6287a3844add5efda626e1b79742e37630179da7 /arch
parent26e6fa2b63ecd02bafdfc9fbf7aed9b7db912186 (diff)
downloadlinux-29539db4287ddcc382565531341eae92cb107110.tar.gz
linux-29539db4287ddcc382565531341eae92cb107110.tar.bz2
linux-29539db4287ddcc382565531341eae92cb107110.zip
ARM: 9447/1: arm/memremap: fix arch_memremap_can_ram_remap()
commit 96e0b355883006554a0bee3697da475971d6bba8 upstream. arm/memremap: fix arch_memremap_can_ram_remap() commit 260364d112bc ("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: 260364d112bc ("arm[64]/memremap: don't abuse pfn_valid() to ensure presence of linear map") Signed-off-by: Ross Stutterheim <ross.stutterheim@garmin.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: stable@vger.kernel.org Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mm/ioremap.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 1c5aeba9bc27..7801c5bb775d 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -515,7 +515,5 @@ void __init early_ioremap_init(void)
bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,
unsigned long flags)
{
- unsigned long pfn = PHYS_PFN(offset);
-
- return memblock_is_map_memory(pfn);
+ return memblock_is_map_memory(offset);
}