|
@@ -443,6 +443,19 @@ static size_t qcom_iommu_unmap(struct iommu_domain *domain, unsigned long iova,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+static void qcom_iommu_iotlb_sync(struct iommu_domain *domain)
|
|
|
+{
|
|
|
+ struct qcom_iommu_domain *qcom_domain = to_qcom_iommu_domain(domain);
|
|
|
+ struct io_pgtable *pgtable = container_of(qcom_domain->pgtbl_ops,
|
|
|
+ struct io_pgtable, ops);
|
|
|
+ if (!qcom_domain->pgtbl_ops)
|
|
|
+ return;
|
|
|
+
|
|
|
+ pm_runtime_get_sync(qcom_domain->iommu->dev);
|
|
|
+ qcom_iommu_tlb_sync(pgtable->cookie);
|
|
|
+ pm_runtime_put_sync(qcom_domain->iommu->dev);
|
|
|
+}
|
|
|
+
|
|
|
static phys_addr_t qcom_iommu_iova_to_phys(struct iommu_domain *domain,
|
|
|
dma_addr_t iova)
|
|
|
{
|
|
@@ -570,6 +583,8 @@ static const struct iommu_ops qcom_iommu_ops = {
|
|
|
.map = qcom_iommu_map,
|
|
|
.unmap = qcom_iommu_unmap,
|
|
|
.map_sg = default_iommu_map_sg,
|
|
|
+ .flush_iotlb_all = qcom_iommu_iotlb_sync,
|
|
|
+ .iotlb_sync = qcom_iommu_iotlb_sync,
|
|
|
.iova_to_phys = qcom_iommu_iova_to_phys,
|
|
|
.add_device = qcom_iommu_add_device,
|
|
|
.remove_device = qcom_iommu_remove_device,
|