summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2016-09-12 18:14:00 +0200
committerWill Deacon <will.deacon@arm.com>2016-09-16 10:34:22 +0200
commitfade1ec055dc6b6373e7487906b7899b41d0c46f (patch)
treed8583918947bb5936ecf6e26f8b22598cca7e604 /arch
parentiommu/dma: Add support for mapping MSIs (diff)
downloadlinux-fade1ec055dc6b6373e7487906b7899b41d0c46f.tar.xz
linux-fade1ec055dc6b6373e7487906b7899b41d0c46f.zip
iommu/dma: Avoid PCI host bridge windows
With our DMA ops enabled for PCI devices, we should avoid allocating IOVAs which a host bridge might misinterpret as peer-to-peer DMA and lead to faults, corruption or other badness. To be safe, punch out holes for all of the relevant host bridge's windows when initialising a DMA domain for a PCI device. CC: Marek Szyprowski <m.szyprowski@samsung.com> CC: Inki Dae <inki.dae@samsung.com> Reported-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/mm/dma-mapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index c4284c432ae8..610d8e53011e 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -827,7 +827,7 @@ static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,
* then the IOMMU core will have already configured a group for this
* device, and allocated the default domain for that group.
*/
- if (!domain || iommu_dma_init_domain(domain, dma_base, size)) {
+ if (!domain || iommu_dma_init_domain(domain, dma_base, size, dev)) {
pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
dev_name(dev));
return false;