powerpc/mm/32: Use page_is_ram to check for RAM
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 28 Mar 2018 00:25:42 +0000 (02:25 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Sat, 31 Mar 2018 13:47:43 +0000 (00:47 +1100)
commit2bbf63264ab2e8cbc740c738f66984b2aafa29c5
tree4610ddecbf8a4af5baed26bff2b2f1ebff4d0e2f
parentf65e67c7e3308c0af08080782d79a8cb95c44929
powerpc/mm/32: Use page_is_ram to check for RAM

On systems where there is MMIO space between different blocks of RAM in
the physical address space, __ioremap_caller did not allow mapping these
MMIO areas, because they were below the end RAM and thus considered RAM
as well.  Use the memblock-based page_is_ram function, which returns
false for such MMIO holes.

v2:
  Keep the check for p < virt_to_phys(high_memory). On 32-bit systems
  with high memory (memory above physical address 4GiB), the high memory
  is expected to be available though ioremap. The high_memory variable
  marks the end of low memory; comparing against it means that only
  ioremap requests for low RAM will be denied.
  Reported by Michael Ellerman.

Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/pgtable_32.c