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

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

iommu/arm-smmu: return failure from iommu_iova_to_phys when ATOS fails



Currently, we fall back to a software table walk if ATOS fails.  This
can mask problems that might be harder to debug later.  Rather than
doing a software table walk and returning success, just print the result
of the software table walk to the log and return failure.

Change-Id: I28335b33977e60aea43d2c0ee1f4571a14a5e191
Signed-off-by: default avatarMitchel Humpherys <mitchelh@codeaurora.org>
parent 3d72d5d2
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1966,9 +1966,7 @@ static phys_addr_t arm_smmu_iova_to_phys_hard(struct iommu_domain *domain,

	if (readl_poll_timeout_atomic(cb_base + ARM_SMMU_CB_ATSR, tmp,
				!(tmp & ATSR_ACTIVE), 5, 50)) {
		dev_err(dev,
			"iova to phys timed out on 0x%pa. Falling back to software table walk.\n",
			&iova);
		dev_err(dev, "iova to phys timed out\n");
		goto err_resume;
	}

@@ -1997,7 +1995,11 @@ err_resume:
err_unlock:
	spin_unlock_irqrestore(&smmu->atos_lock, flags);
	arm_smmu_disable_clocks(smmu);
	return arm_smmu_iova_to_phys_soft(domain, iova);
	phys = arm_smmu_iova_to_phys_soft(domain, iova);
	dev_err(dev,
		"iova to phys failed 0x%pa. software table walk result=%pa.\n",
		&iova, &phys);
	return 0;
}

static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain,