Skip to content

Commit dc98b84

Browse files
rmurphy-armjoergroedel
authored andcommitted
iommu/exynos: Don't unconditionally steal bus ops
Removing the early device registration hook overlooked the fact that it only ran conditionally on a compatible device being present in the DT. With exynos_iommu_init() now running as an unconditional initcall, problems arise on non-Exynos systems when other IOMMU drivers find themselves unable to install their ops on the platform bus, or at worst the Exynos ops get called with someone else's domain and all hell breaks loose. The global ops/cache setup could probably all now be triggered from the first IOMMU probe, as with dma_dev assigment, but for the time being the simplest fix is to resurrect the logic from commit a7b67cd ("iommu/exynos: Play nice in multi-platform builds") to explicitly check the DT for the presence of an Exynos IOMMU before trying anything. Fixes: 928055a ("iommu/exynos: Remove custom platform device registration code") Signed-off-by: Robin Murphy <[email protected]> Acked-by: Marek Szyprowski <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent a8750dd commit dc98b84

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/iommu/exynos-iommu.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,8 +1353,15 @@ static const struct iommu_ops exynos_iommu_ops = {
13531353

13541354
static int __init exynos_iommu_init(void)
13551355
{
1356+
struct device_node *np;
13561357
int ret;
13571358

1359+
np = of_find_matching_node(NULL, sysmmu_of_match);
1360+
if (!np)
1361+
return 0;
1362+
1363+
of_node_put(np);
1364+
13581365
lv2table_kmem_cache = kmem_cache_create("exynos-iommu-lv2table",
13591366
LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL);
13601367
if (!lv2table_kmem_cache) {

0 commit comments

Comments
 (0)