[COMMON] iommu: fix condition for exynos-iommu
authorJanghyuck Kim <janghyuck.kim@samsung.com>
Tue, 26 Apr 2016 05:03:18 +0000 (14:03 +0900)
committerSangwook Ju <sw.ju@samsung.com>
Mon, 14 May 2018 10:45:21 +0000 (19:45 +0900)
Fix up condition of iommu framework to operate exynos-iommu.
exynos-iommu doesn't use dma-iommu for virtual address management.
And it doesn't need to care about group status in attach_device.

Change-Id: Ie9cbb7f2a4963fb279356d54be36c71b7ffd293d
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
drivers/iommu/dma-iommu.c
drivers/iommu/iommu.c

index 9d1cebe7f6cbb14517718f5fd6d03de7ee503956..64a55cce5af2c300ad73a6794a364f3919a3f2a5 100644 (file)
@@ -274,6 +274,10 @@ int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,
        struct iova_domain *iovad = &cookie->iovad;
        unsigned long order, base_pfn, end_pfn;
 
+       /* HACK: return success always */
+       if (!cookie)
+               return 0;
+
        if (!cookie || cookie->type != IOMMU_DMA_IOVA_COOKIE)
                return -EINVAL;
 
index 3de5c0bcb5cc9f32b6fb615ce38f5729ae86d407..d9f4ebdf1e04566113f4cf540007e48cd616e85b 100644 (file)
@@ -1302,6 +1302,9 @@ int iommu_attach_device(struct iommu_domain *domain, struct device *dev)
        struct iommu_group *group;
        int ret;
 
+       /* HACK: We don't care iommu group */
+       return __iommu_attach_device(domain, dev);
+
        group = iommu_group_get(dev);
        /*
         * Lock the group to make sure the device-count doesn't