• Doug Berger's avatar
    swiotlb: relocate PageHighMem test away from rmem_swiotlb_setup · a90922fa
    Doug Berger authored
    The reservedmem_of_init_fn's are invoked very early at boot before the
    memory zones have even been defined. This makes it inappropriate to test
    whether the page corresponding to a PFN is in ZONE_HIGHMEM from within
    one.
    
    Removing the check allows an ARM 32-bit kernel with SPARSEMEM enabled to
    boot properly since otherwise we would be de-referencing an
    uninitialized sparsemem map to perform pfn_to_page() check.
    
    The arm64 architecture happens to work (and also has no high memory) but
    other 32-bit architectures could also be having similar issues.
    
    While it would be nice to provide early feedback about a reserved DMA
    pool residing in highmem, it is not possible to do that until the first
    time we try to use it, which is where the check is moved to.
    
    Fixes: 0b84e4f8 ("swiotlb: Add restricted DMA pool initialization")
    Signed-off-by: default avatarDoug Berger <opendmb@gmail.com>
    Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    a90922fa
swiotlb.c 28.8 KB