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

Commit 6844c231 authored by Patrick Daly's avatar Patrick Daly
Browse files

arm: mm: Set dma_ops_setup only for IOMMU_DOMAIN_DMA



Commit ef027fed ("arm: dma-mapping: don't attach the clients
to smmu device by default") changed the behavior such that
iommu clients need to attach manually, except for the
case of IOMMU_DOMAIN_DMA. There is a similar requirement for
detach, so modify dma_ops_setup accordingly.

Change-Id: I41117215e14552abbc621433eef16a44a33cd386
Signed-off-by: default avatarPatrick Daly <pdaly@codeaurora.org>
parent dc9a2b8f
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2718,10 +2718,13 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
	if (dev->dma_ops)
		return;

	if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu))
	if (arm_setup_iommu_dma_ops(dev, dma_base, size, iommu)) {
		dma_ops = arm_get_iommu_dma_map_ops(coherent);
	else
		dev->archdata.dma_ops_setup = true;
	} else {
		dma_ops = arm_get_dma_map_ops(coherent);
		dev->archdata.dma_ops_setup = false;
	}

	set_dma_ops(dev, dma_ops);

@@ -2731,7 +2734,6 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
		dev->dma_ops = xen_dma_ops;
	}
#endif
	dev->archdata.dma_ops_setup = true;
}
EXPORT_SYMBOL(arch_setup_dma_ops);