Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8d83b5a1 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: mm: dma-mapping: Disable default dma/iommu interface"

parents 73c7796f 533f63f2
Loading
Loading
Loading
Loading
+0 −39
Original line number Original line Diff line number Diff line
@@ -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,
@@ -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()) {