diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index cd9d92239b01f8c8a0c6de575b9c3f6a133717ff..2241470de0dad6643646a761849273ff52afebd5 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -173,6 +173,18 @@ int pfn_valid(unsigned long pfn) if (!valid_section(__pfn_to_section(pfn))) return 0; + + /* + * ZONE_DEVICE memory does not have the memblock entries. + * memblock_is_map_memory() check for ZONE_DEVICE based + * addresses will always fail. Even the normal hotplugged + * memory will never have MEMBLOCK_NOMAP flag set in their + * memblock entries. Skip memblock search for all non early + * memory sections covering all of hotplug memory including + * both normal and ZONE_DEVICE based. + */ + if (!early_section(__pfn_to_section(pfn))) + return pfn_section_valid(__pfn_to_section(pfn), pfn); #endif return memblock_is_map_memory(addr); }