Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da9c2118 authored by Mitchel Humpherys's avatar Mitchel Humpherys Committed by Matt Wagantall
Browse files

ipa: set IOMMU domain attributes before attaching



IOMMU domain attributes should be set *before* attaching to an IOMMU,
but we're currently setting them after attaching in the IPA driver,
which causes the attributes to be ignored.  Fix this by moving the
domain attribute setting code above the attach.

Change-Id: I94f80aed632eb4d731f94678b51d780bfddde171
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent c33ce85b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -3833,12 +3833,6 @@ static int ipa_smmu_ap_cb_probe(struct device *dev)
		return -EPROBE_DEFER;
	}

	result = arm_iommu_attach_device(cb->dev, cb->mapping);
	if (result) {
		IPAERR("couldn't attach to IOMMU ret=%d\n", result);
		return result;
	}

	if (smmu_disable_htw) {
		if (iommu_domain_set_attr(cb->mapping->domain,
				DOMAIN_ATTR_COHERENT_HTW_DISABLE,
@@ -3857,6 +3851,12 @@ static int ipa_smmu_ap_cb_probe(struct device *dev)
		return -EIO;
	}

	result = arm_iommu_attach_device(cb->dev, cb->mapping);
	if (result) {
		IPAERR("couldn't attach to IOMMU ret=%d\n", result);
		return result;
	}

	cb->valid = true;
	smmu_present = true;