Commit c9632183 authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Christoph Hellwig
Browse files

iommu: Explicitly skip bus address marked segments in __iommu_map_sg()



In order to support PCI P2PDMA mappings with dma-iommu, explicitly skip
any segments marked with sg_dma_mark_bus_address() in __iommu_map_sg().

These segments should not be mapped into the IOVA and will be handled
separately in as subsequent patch for dma-iommu.

Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 159bf192
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2457,6 +2457,9 @@ static ssize_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
			len = 0;
		}

		if (sg_is_dma_bus_address(sg))
			goto next;

		if (len) {
			len += sg->length;
		} else {
@@ -2464,6 +2467,7 @@ static ssize_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
			start = s_phys;
		}

next:
		if (++i < nents)
			sg = sg_next(sg);
	}