Skip to content

Commit eb46d7c

Browse files
ffainelligregkh
authored andcommitted
ARM: Qualify enabling of swiotlb_init()
commit fcf0448 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: ad3c7b1 ("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>
1 parent 79286ea commit eb46d7c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎arch/arm/mm/init.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,11 @@ static void __init free_highpages(void)
378378
void __init mem_init(void)
379379
{
380380
#ifdef CONFIG_ARM_LPAE
381-
swiotlb_init(1);
381+
if (swiotlb_force == SWIOTLB_FORCE ||
382+
max_pfn > arm_dma_pfn_limit)
383+
swiotlb_init(1);
384+
else
385+
swiotlb_force = SWIOTLB_NO_FORCE;
382386
#endif
383387

384388
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

0 commit comments

Comments
 (0)