Skip to content

Commit 4fac807

Browse files
author
Christoph Hellwig
committed
ia64: clean up swiotlb support
Move the few remaining bits of swiotlb glue towards their callers, and remove the pointless on ia64 swiotlb variable. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Christian König <[email protected]>
1 parent 543cea9 commit 4fac807

File tree

6 files changed

+20
-58
lines changed

6 files changed

+20
-58
lines changed

arch/ia64/include/asm/dma-mapping.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
*/
99
#include <asm/machvec.h>
1010
#include <linux/scatterlist.h>
11-
#include <asm/swiotlb.h>
1211
#include <linux/dma-debug.h>
1312

1413
#define ARCH_HAS_DMA_GET_REQUIRED_MASK

arch/ia64/include/asm/swiotlb.h

Lines changed: 0 additions & 18 deletions
This file was deleted.

arch/ia64/kernel/dma-mapping.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/dma-mapping.h>
3+
#include <linux/swiotlb.h>
34
#include <linux/export.h>
45

56
/* Set this to 1 if there is a HW IOMMU in the system */
@@ -23,3 +24,11 @@ const struct dma_map_ops *dma_get_ops(struct device *dev)
2324
return dma_ops;
2425
}
2526
EXPORT_SYMBOL(dma_get_ops);
27+
28+
#ifdef CONFIG_SWIOTLB
29+
void __init swiotlb_dma_init(void)
30+
{
31+
dma_ops = &swiotlb_dma_ops;
32+
swiotlb_init(1);
33+
}
34+
#endif

arch/ia64/kernel/pci-dma.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,16 @@ void __init pci_iommu_alloc(void)
104104
detect_intel_iommu();
105105

106106
#ifdef CONFIG_SWIOTLB
107-
pci_swiotlb_init();
108-
#endif
107+
if (!iommu_detected) {
108+
#ifdef CONFIG_IA64_GENERIC
109+
printk(KERN_INFO "PCI-DMA: Re-initialize machine vector.\n");
110+
machvec_init("dig");
111+
swiotlb_dma_init();
112+
#else
113+
panic("Unable to find Intel IOMMU");
114+
#endif /* CONFIG_IA64_GENERIC */
115+
}
116+
#endif /* CONFIG_SWIOTLB */
109117
}
110118

111119
#endif

arch/ia64/kernel/pci-swiotlb.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

drivers/iommu/intel-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4808,7 +4808,7 @@ int __init intel_iommu_init(void)
48084808
up_write(&dmar_global_lock);
48094809
pr_info("Intel(R) Virtualization Technology for Directed I/O\n");
48104810

4811-
#ifdef CONFIG_SWIOTLB
4811+
#if defined(CONFIG_X86) && defined(CONFIG_SWIOTLB)
48124812
swiotlb = 0;
48134813
#endif
48144814
dma_ops = &intel_dma_ops;

0 commit comments

Comments
 (0)