Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f23763ab authored by Florian Fainelli's avatar Florian Fainelli Committed by Greg Kroah-Hartman
Browse files

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: ad3c7b18 ("arm: use swiotlb for bounce buffering on LPAE configs")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6bfdc305
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -469,7 +469,11 @@ static void __init free_highpages(void)
void __init mem_init(void)
{
#ifdef CONFIG_ARM_LPAE
	if (swiotlb_force == SWIOTLB_FORCE ||
	    max_pfn > arm_dma_pfn_limit)
		swiotlb_init(1);
	else
		swiotlb_force = SWIOTLB_NO_FORCE;
#endif

	set_max_mapnr(pfn_to_page(max_pfn) - mem_map);