Skip to content

Commit d36464f

Browse files
jgunthorpewilldeacon
authored andcommitted
iommu/arm-smmu-v3: Use the identity/blocked domain during release
Consolidate some more code by having release call arm_smmu_attach_dev_identity/blocked() instead of open coding this. Reviewed-by: Nicolin Chen <[email protected]> Tested-by: Shameer Kolothum <[email protected]> Tested-by: Nicolin Chen <[email protected]> Tested-by: Moritz Fischer <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 352bd64 commit d36464f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2924,19 +2924,16 @@ static struct iommu_device *arm_smmu_probe_device(struct device *dev)
29242924
static void arm_smmu_release_device(struct device *dev)
29252925
{
29262926
struct arm_smmu_master *master = dev_iommu_priv_get(dev);
2927-
struct arm_smmu_ste target;
29282927

29292928
if (WARN_ON(arm_smmu_master_sva_enabled(master)))
29302929
iopf_queue_remove_device(master->smmu->evtq.iopf, dev);
29312930

29322931
/* Put the STE back to what arm_smmu_init_strtab() sets */
29332932
if (disable_bypass && !dev->iommu->require_direct)
2934-
arm_smmu_make_abort_ste(&target);
2933+
arm_smmu_attach_dev_blocked(&arm_smmu_blocked_domain, dev);
29352934
else
2936-
arm_smmu_make_bypass_ste(&target);
2937-
arm_smmu_install_ste_for_dev(master, &target);
2935+
arm_smmu_attach_dev_identity(&arm_smmu_identity_domain, dev);
29382936

2939-
arm_smmu_detach_dev(master);
29402937
arm_smmu_disable_pasid(master);
29412938
arm_smmu_remove_master(master);
29422939
if (master->cd_table.cdtab)

0 commit comments

Comments
 (0)