Skip to content

Commit fcf0448

Browse files
ffainellikonradwilk
authored andcommitted
ARM: Qualify enabling of swiotlb_init()
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 <[email protected]> Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
1 parent 2cbc277 commit fcf0448

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/arm/mm/init.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ static void __init free_highpages(void)
301301
void __init mem_init(void)
302302
{
303303
#ifdef CONFIG_ARM_LPAE
304-
swiotlb_init(1);
304+
if (swiotlb_force == SWIOTLB_FORCE ||
305+
max_pfn > arm_dma_pfn_limit)
306+
swiotlb_init(1);
307+
else
308+
swiotlb_force = SWIOTLB_NO_FORCE;
305309
#endif
306310

307311
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);

0 commit comments

Comments
 (0)