ARM: Qualify enabling of swiotlb_init()
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 19 Mar 2021 04:03:33 +0000 (21:03 -0700)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:33:01 +0000 (12:33 +0100)
commit4e2701dd282f3be9811ee4b7a4403bc5b60adc1e
tree780af530a5efe030c9b9756556657db7662438b1
parentfaad9bf05384b019eb0e5b10cbee0295ae1d70bf
ARM: Qualify enabling of swiotlb_init()

commit fcf044891c84e38fc90eb736b818781bccf94e38 upstream.

We do not need a SWIOTLB unless we have DRAM that is addressable beyond
the arm_dma_limit. Compare max_pfn with arm_dma_pfn_limit to determine
whether we do need a SWIOTLB to be initialized.

Fixes: ad3c7b18c5b3 ("arm: use swiotlb for bounce buffering on LPAE configs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mm/init.c