Skip to content

Commit 6ac7dff

Browse files
jgunthorpewilldeacon
authored andcommitted
iommu: Add a kdoc to iommu_unmap()
Describe the most conservative version of the driver implementations. All drivers should support this. Many drivers support extending the range if a large page is hit, but let's not make that officially approved API. The main point is to document explicitly that split is not supported. Reviewed-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/3-v3-b3a5b5937f56+7bb-arm_no_split_jgg@nvidia.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent fd50651 commit 6ac7dff

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/iommu/iommu.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2586,6 +2586,20 @@ static size_t __iommu_unmap(struct iommu_domain *domain,
25862586
return unmapped;
25872587
}
25882588

2589+
/**
2590+
* iommu_unmap() - Remove mappings from a range of IOVA
2591+
* @domain: Domain to manipulate
2592+
* @iova: IO virtual address to start
2593+
* @size: Length of the range starting from @iova
2594+
*
2595+
* iommu_unmap() will remove a translation created by iommu_map(). It cannot
2596+
* subdivide a mapping created by iommu_map(), so it should be called with IOVA
2597+
* ranges that match what was passed to iommu_map(). The range can aggregate
2598+
* contiguous iommu_map() calls so long as no individual range is split.
2599+
*
2600+
* Returns: Number of bytes of IOVA unmapped. iova + res will be the point
2601+
* unmapping stopped.
2602+
*/
25892603
size_t iommu_unmap(struct iommu_domain *domain,
25902604
unsigned long iova, size_t size)
25912605
{

0 commit comments

Comments
 (0)