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

Commit 452a8705 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "iommu: support querying IOVA coherency" into msm-4.9

parents 2db1c251 5bb64228
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1286,6 +1286,14 @@ phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
	return domain->ops->iova_to_phys_hard(domain, iova);
}

bool iommu_is_iova_coherent(struct iommu_domain *domain, dma_addr_t iova)
{
	if (unlikely(domain->ops->is_iova_coherent == NULL))
		return 0;

	return domain->ops->is_iova_coherent(domain, iova);
}

size_t iommu_pgsize(unsigned long pgsize_bitmap,
		    unsigned long addr_merge, size_t size)
{
+9 −0
Original line number Diff line number Diff line
@@ -245,6 +245,7 @@ struct iommu_ops {

	int (*of_xlate)(struct device *dev, struct of_phandle_args *args);

	bool (*is_iova_coherent)(struct iommu_domain *domain, dma_addr_t iova);
	unsigned long pgsize_bitmap;
};

@@ -278,6 +279,8 @@ extern size_t default_iommu_map_sg(struct iommu_domain *domain, unsigned long io
extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova);
extern phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
					   dma_addr_t iova);
extern bool iommu_is_iova_coherent(struct iommu_domain *domain,
				dma_addr_t iova);
extern void iommu_set_fault_handler(struct iommu_domain *domain,
			iommu_fault_handler_t handler, void *token);

@@ -519,6 +522,12 @@ static inline phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
	return 0;
}

static inline bool iommu_is_iova_coherent(struct iommu_domain *domain,
					  dma_addr_t iova)
{
	return 0;
}

static inline void iommu_set_fault_handler(struct iommu_domain *domain,
				iommu_fault_handler_t handler, void *token)
{