Skip to content

Commit 687842e

Browse files
Christoph Hellwigjgross1
authored andcommitted
arm64: do not set SWIOTLB_NO_FORCE when swiotlb is required
Although SWIOTLB_NO_FORCE is meant to allow later calls to swiotlb_init, today dma_direct_map_page returns error if SWIOTLB_NO_FORCE. For now, without a larger overhaul of SWIOTLB_NO_FORCE, the best we can do is to avoid setting SWIOTLB_NO_FORCE in mem_init when we know that it is going to be required later (e.g. Xen requires it). CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] Fixes: 2726bf3 ("swiotlb: Make SWIOTLB_NO_FORCE perform no allocation") Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Stefano Stabellini <[email protected]> Reviewed-by: Juergen Gross <[email protected]> Acked-by: Catalin Marinas <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Juergen Gross <[email protected]>
1 parent cb6f6b3 commit 687842e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/mm/init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <linux/sizes.h>
4444
#include <asm/tlb.h>
4545
#include <asm/alternative.h>
46+
#include <asm/xen/swiotlb-xen.h>
4647

4748
/*
4849
* We need to be able to catch inadvertent references to memstart_addr
@@ -482,7 +483,7 @@ void __init mem_init(void)
482483
if (swiotlb_force == SWIOTLB_FORCE ||
483484
max_pfn > PFN_DOWN(arm64_dma_phys_limit))
484485
swiotlb_init(1);
485-
else
486+
else if (!xen_swiotlb_detect())
486487
swiotlb_force = SWIOTLB_NO_FORCE;
487488

488489
set_max_mapnr(max_pfn - PHYS_PFN_OFFSET);

0 commit comments

Comments
 (0)