ARM: Qualify enabling of swiotlb_init()
commitfcf044891cupstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
79286ea830
commit
eb46d7c8ae
+5
-1
@@ -378,7 +378,11 @@ static void __init free_highpages(void)
|
|||||||
void __init mem_init(void)
|
void __init mem_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ARM_LPAE
|
#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
|
#endif
|
||||||
|
|
||||||
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
|
set_max_mapnr(pfn_to_page(max_pfn) - mem_map);
|
||||||
|
|||||||
Reference in New Issue
Block a user