Skip to content

Commit

Permalink
iommu/exynos: Use first SYSMMU in controllers list for IOMMU core
Browse files Browse the repository at this point in the history
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 <jroedel@suse.de>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/20200429133712.31431-31-joro@8bytes.org
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed May 5, 2020
1 parent 6785eb9 commit 66ae88e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/iommu/exynos-iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,11 @@ static int exynos_iommu_add_device(struct device *dev)
}
iommu_group_put(group);

/* There is always at least one entry, see exynos_iommu_of_xlate() */
data = list_first_entry(&owner->controllers,
struct sysmmu_drvdata, owner_node);
iommu_device_link(&data->iommu, dev);

return 0;
}

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

list_for_each_entry(data, &owner->controllers, owner_node)
device_link_del(data->link);

/* There is always at least one entry, see exynos_iommu_of_xlate() */
data = list_first_entry(&owner->controllers,
struct sysmmu_drvdata, owner_node);
iommu_device_unlink(&data->iommu, dev);
}

static int exynos_iommu_of_xlate(struct device *dev,
Expand Down

0 comments on commit 66ae88e

Please sign in to comment.