This patch adds the .capable into iommu_ops that can merge scatter
gather segments.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda...@renesas.com>
---
 drivers/iommu/ipmmu-vmsa.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 408ad0b..81170b8 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -608,6 +608,18 @@ static irqreturn_t ipmmu_irq(int irq, void *dev)
  * IOMMU Operations
  */
 
+static bool ipmmu_capable(enum iommu_cap cap)
+{
+       switch (cap) {
+       case IOMMU_CAP_MERGING:
+               return true;
+       default:
+               break;
+       }
+
+       return false;
+}
+
 static struct iommu_domain *__ipmmu_domain_alloc(unsigned type)
 {
        struct ipmmu_vmsa_domain *domain;
@@ -950,6 +962,7 @@ static struct iommu_group *ipmmu_find_group(struct device 
*dev)
 }
 
 static const struct iommu_ops ipmmu_ops = {
+       .capable = ipmmu_capable,
        .domain_alloc = ipmmu_domain_alloc,
        .domain_free = ipmmu_domain_free,
        .attach_dev = ipmmu_attach_device,
-- 
2.7.4

Reply via email to