Skip to content

Commit bc5fddf

Browse files
rmurphy-armgregkh
authored andcommitted
iommu/exynos: Don't unconditionally steal bus ops
[ Upstream commit dc98b84 ] 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]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 77d17d0 commit bc5fddf

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
@@ -1344,8 +1344,15 @@ static const struct iommu_ops exynos_iommu_ops = {
13441344

13451345
static int __init exynos_iommu_init(void)
13461346
{
1347+
struct device_node *np;
13471348
int ret;
13481349

1350+
np = of_find_matching_node(NULL, sysmmu_of_match);
1351+
if (!np)
1352+
return 0;
1353+
1354+
of_node_put(np);
1355+
13491356
lv2table_kmem_cache = kmem_cache_create("exynos-iommu-lv2table",
13501357
LV2TABLE_SIZE, LV2TABLE_SIZE, 0, NULL);
13511358
if (!lv2table_kmem_cache) {

0 commit comments

Comments
 (0)