Skip to content

Commit b419c5e

Browse files
lumagwilldeacon
authored andcommitted
Revert "iommu/arm-smmu: Convert to domain_alloc_paging()"
This reverts commit 9b3febc ("iommu/arm-smmu: Convert to domain_alloc_paging()"). It breaks Qualcomm MSM8996 platform. Calling arm_smmu_write_context_bank() from new codepath results in the platform being reset because of the unclocked hardware access. Fixes: 9b3febc ("iommu/arm-smmu: Convert to domain_alloc_paging()") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Acked-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/20240213-iommu-revert-domain-alloc-v1-1-325ff55dece4@linaro.org Signed-off-by: Will Deacon <will@kernel.org>
1 parent 41bccc9 commit b419c5e

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

drivers/iommu/arm/arm-smmu/arm-smmu.c

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,14 @@ static void arm_smmu_destroy_domain_context(struct arm_smmu_domain *smmu_domain)
859859
arm_smmu_rpm_put(smmu);
860860
}
861861

862-
static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev)
862+
static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
863863
{
864864
struct arm_smmu_domain *smmu_domain;
865865

866+
if (type != IOMMU_DOMAIN_UNMANAGED) {
867+
if (using_legacy_binding || type != IOMMU_DOMAIN_DMA)
868+
return NULL;
869+
}
866870
/*
867871
* Allocate the domain and initialise some of its data structures.
868872
* We can't really do anything meaningful until we've added a
@@ -875,15 +879,6 @@ static struct iommu_domain *arm_smmu_domain_alloc_paging(struct device *dev)
875879
mutex_init(&smmu_domain->init_mutex);
876880
spin_lock_init(&smmu_domain->cb_lock);
877881

878-
if (dev) {
879-
struct arm_smmu_master_cfg *cfg = dev_iommu_priv_get(dev);
880-
881-
if (arm_smmu_init_domain_context(smmu_domain, cfg->smmu, dev)) {
882-
kfree(smmu_domain);
883-
return NULL;
884-
}
885-
}
886-
887882
return &smmu_domain->domain;
888883
}
889884

@@ -1600,7 +1595,7 @@ static struct iommu_ops arm_smmu_ops = {
16001595
.identity_domain = &arm_smmu_identity_domain,
16011596
.blocked_domain = &arm_smmu_blocked_domain,
16021597
.capable = arm_smmu_capable,
1603-
.domain_alloc_paging = arm_smmu_domain_alloc_paging,
1598+
.domain_alloc = arm_smmu_domain_alloc,
16041599
.probe_device = arm_smmu_probe_device,
16051600
.release_device = arm_smmu_release_device,
16061601
.probe_finalize = arm_smmu_probe_finalize,

0 commit comments

Comments
 (0)