Loading arch/arm64/mm/dma-mapping.c +0 −39 Original line number Original line Diff line number Diff line Loading @@ -976,48 +976,10 @@ static int __init __iommu_dma_init(void) } } arch_initcall(__iommu_dma_init); arch_initcall(__iommu_dma_init); static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, const struct iommu_ops *ops) { struct iommu_domain *domain; if (!ops) return; /* * The IOMMU core code allocates the default DMA domain, which the * underlying IOMMU driver needs to support via the dma-iommu layer. */ domain = iommu_get_domain_for_dev(dev); if (!domain) goto out_err; if (domain->type == IOMMU_DOMAIN_DMA) { if (iommu_dma_init_domain(domain, dma_base, size, dev)) goto out_err; dev->dma_ops = &iommu_dma_ops; } return; out_err: pr_debug("Failed to set up IOMMU for device %s; retaining platform DMA ops\n", dev_name(dev)); } void arch_teardown_dma_ops(struct device *dev) void arch_teardown_dma_ops(struct device *dev) { { dev->dma_ops = NULL; dev->dma_ops = NULL; } } #else static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, const struct iommu_ops *iommu) { } #endif /* CONFIG_IOMMU_DMA */ #endif /* CONFIG_IOMMU_DMA */ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, Loading @@ -1027,7 +989,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, dev->dma_ops = &arm64_swiotlb_dma_ops; dev->dma_ops = &arm64_swiotlb_dma_ops; dev->archdata.dma_coherent = coherent; dev->archdata.dma_coherent = coherent; __iommu_setup_dma_ops(dev, dma_base, size, iommu); #ifdef CONFIG_XEN #ifdef CONFIG_XEN if (xen_initial_domain()) { if (xen_initial_domain()) { Loading Loading
arch/arm64/mm/dma-mapping.c +0 −39 Original line number Original line Diff line number Diff line Loading @@ -976,48 +976,10 @@ static int __init __iommu_dma_init(void) } } arch_initcall(__iommu_dma_init); arch_initcall(__iommu_dma_init); static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, const struct iommu_ops *ops) { struct iommu_domain *domain; if (!ops) return; /* * The IOMMU core code allocates the default DMA domain, which the * underlying IOMMU driver needs to support via the dma-iommu layer. */ domain = iommu_get_domain_for_dev(dev); if (!domain) goto out_err; if (domain->type == IOMMU_DOMAIN_DMA) { if (iommu_dma_init_domain(domain, dma_base, size, dev)) goto out_err; dev->dma_ops = &iommu_dma_ops; } return; out_err: pr_debug("Failed to set up IOMMU for device %s; retaining platform DMA ops\n", dev_name(dev)); } void arch_teardown_dma_ops(struct device *dev) void arch_teardown_dma_ops(struct device *dev) { { dev->dma_ops = NULL; dev->dma_ops = NULL; } } #else static void __iommu_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, const struct iommu_ops *iommu) { } #endif /* CONFIG_IOMMU_DMA */ #endif /* CONFIG_IOMMU_DMA */ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, Loading @@ -1027,7 +989,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, dev->dma_ops = &arm64_swiotlb_dma_ops; dev->dma_ops = &arm64_swiotlb_dma_ops; dev->archdata.dma_coherent = coherent; dev->archdata.dma_coherent = coherent; __iommu_setup_dma_ops(dev, dma_base, size, iommu); #ifdef CONFIG_XEN #ifdef CONFIG_XEN if (xen_initial_domain()) { if (xen_initial_domain()) { Loading