From: Janghyuck Kim Date: Tue, 26 Apr 2016 05:03:18 +0000 (+0900) Subject: [COMMON] iommu: fix condition for exynos-iommu X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=04778aa6fd3800cfdcf4240200ae3101ff14e2ab;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] iommu: fix condition for exynos-iommu 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 --- diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 9d1cebe7f6cb..64a55cce5af2 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -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; diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 3de5c0bcb5cc..d9f4ebdf1e04 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -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