Skip to content

Commit 66ae88e

Browse files
committed
iommu/exynos: Use first SYSMMU in controllers list for IOMMU core
On Exynos platforms there can be more than one SYSMMU (IOMMU) for one DMA master device. Since the IOMMU core code expects only one hardware IOMMU, use the first SYSMMU in the list. Signed-off-by: Joerg Roedel <[email protected]> Tested-by: Marek Szyprowski <[email protected]> Acked-by: Marek Szyprowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 6785eb9 commit 66ae88e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/iommu/exynos-iommu.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,11 @@ static int exynos_iommu_add_device(struct device *dev)
12611261
}
12621262
iommu_group_put(group);
12631263

1264+
/* There is always at least one entry, see exynos_iommu_of_xlate() */
1265+
data = list_first_entry(&owner->controllers,
1266+
struct sysmmu_drvdata, owner_node);
1267+
iommu_device_link(&data->iommu, dev);
1268+
12641269
return 0;
12651270
}
12661271

@@ -1286,6 +1291,11 @@ static void exynos_iommu_remove_device(struct device *dev)
12861291

12871292
list_for_each_entry(data, &owner->controllers, owner_node)
12881293
device_link_del(data->link);
1294+
1295+
/* There is always at least one entry, see exynos_iommu_of_xlate() */
1296+
data = list_first_entry(&owner->controllers,
1297+
struct sysmmu_drvdata, owner_node);
1298+
iommu_device_unlink(&data->iommu, dev);
12891299
}
12901300

12911301
static int exynos_iommu_of_xlate(struct device *dev,

0 commit comments

Comments
 (0)