Skip to content

Commit c963218

Browse files
lsgunthChristoph Hellwig
authored andcommitted
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: Logan Gunthorpe <logang@deltatee.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 159bf19 commit c963218

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/iommu/iommu.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2457,13 +2457,17 @@ static ssize_t __iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
24572457
len = 0;
24582458
}
24592459

2460+
if (sg_is_dma_bus_address(sg))
2461+
goto next;
2462+
24602463
if (len) {
24612464
len += sg->length;
24622465
} else {
24632466
len = sg->length;
24642467
start = s_phys;
24652468
}
24662469

2470+
next:
24672471
if (++i < nents)
24682472
sg = sg_next(sg);
24692473
}

0 commit comments

Comments
 (0)