iommu: support querying IOVA coherency
Support querying whether an IOVA is mapped as coherent. Change-Id: Icd122348e309495b09bcf77628aa1746f0255305 Signed-off-by: Liam Mark <lmark@codeaurora.org>
This commit is contained in:
parent
f18f48d761
commit
90d80a06de
2 changed files with 16 additions and 0 deletions
|
@ -1336,6 +1336,13 @@ phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
|
||||||
return domain->ops->iova_to_phys_hard(domain, iova);
|
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);
|
||||||
|
}
|
||||||
static unsigned long iommu_get_pgsize_bitmap(struct iommu_domain *domain)
|
static unsigned long iommu_get_pgsize_bitmap(struct iommu_domain *domain)
|
||||||
{
|
{
|
||||||
if (domain->ops->get_pgsize_bitmap)
|
if (domain->ops->get_pgsize_bitmap)
|
||||||
|
|
|
@ -237,6 +237,7 @@ struct iommu_ops {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned long (*get_pgsize_bitmap)(struct iommu_domain *domain);
|
unsigned long (*get_pgsize_bitmap)(struct iommu_domain *domain);
|
||||||
|
bool (*is_iova_coherent)(struct iommu_domain *domain, dma_addr_t iova);
|
||||||
unsigned long pgsize_bitmap;
|
unsigned long pgsize_bitmap;
|
||||||
void *priv;
|
void *priv;
|
||||||
};
|
};
|
||||||
|
@ -273,6 +274,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(struct iommu_domain *domain, dma_addr_t iova);
|
||||||
extern phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
|
extern phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
|
||||||
dma_addr_t iova);
|
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,
|
extern void iommu_set_fault_handler(struct iommu_domain *domain,
|
||||||
iommu_fault_handler_t handler, void *token);
|
iommu_fault_handler_t handler, void *token);
|
||||||
extern void iommu_trigger_fault(struct iommu_domain *domain,
|
extern void iommu_trigger_fault(struct iommu_domain *domain,
|
||||||
|
@ -505,6 +508,12 @@ static inline phys_addr_t iommu_iova_to_phys_hard(struct iommu_domain *domain,
|
||||||
return 0;
|
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,
|
static inline void iommu_set_fault_handler(struct iommu_domain *domain,
|
||||||
iommu_fault_handler_t handler, void *token)
|
iommu_fault_handler_t handler, void *token)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue