summaryrefslogtreecommitdiff
path: root/arch/ia64
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2021-04-30 08:53:33 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-30 21:20:35 +0300
commit6d073dad9754c28ab23409f794b3e1ece37d0609 (patch)
tree81f0f814e1ef1247a3997744de69a6f7a66b3770 /arch/ia64
parentd732f47db10f292657356b3be1fb479777e2117c (diff)
downloadlinux-6d073dad9754c28ab23409f794b3e1ece37d0609.tar.xz
ia64: simplify code flow around swiotlb init
Before the change CONFIG_INTEL_IOMMU && !CONFIG_SWIOTLB && !CONFIG_FLATMEM could skip `set_max_mapnr(max_low_pfn);` if iommu is not present on system. Link: https://lkml.kernel.org/r/20210328202439.403601-1-slyfox@gentoo.org Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/mm/init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 16d0d7d22657..a63585db94fe 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -644,13 +644,16 @@ mem_init (void)
* _before_ any drivers that may need the PCI DMA interface are
* initialized or bootmem has been freed.
*/
+ do {
#ifdef CONFIG_INTEL_IOMMU
- detect_intel_iommu();
- if (!iommu_detected)
+ detect_intel_iommu();
+ if (iommu_detected)
+ break;
#endif
#ifdef CONFIG_SWIOTLB
swiotlb_init(1);
#endif
+ } while (0);
#ifdef CONFIG_FLATMEM
BUG_ON(!mem_map);