mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 21:07:02 +09:00
UPSTREAM: 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:ad3c7b18c5("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> (cherry picked from commitfcf044891c) Signed-off-by: Will Deacon <willdeacon@google.com> Bug: 190591509 Change-Id: Ifaa1e8e6bef7c7a18912c1e6b02609e0305dbce5
This commit is contained in:
committed by
Will Deacon
parent
e64f1c94eb
commit
8704c8c5d5
@@ -378,7 +378,11 @@ static void __init free_highpages(void)
|
||||
void __init mem_init(void)
|
||||
{
|
||||
#ifdef CONFIG_ARM_LPAE
|
||||
swiotlb_init(1);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user