diff options
author | Mitchel Humpherys <mitchelh@codeaurora.org> | 2016-04-29 11:41:59 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-20 22:01:03 -0700 |
commit | 4a6f833be0da36c4c0c485929729ae7ff06f34b6 (patch) | |
tree | bd9f9a06117d9bb4eba98b8bdc44fcd0bd32d60b /drivers/iommu/iommu-debug.c | |
parent | 1add8d5a71133292be7e0367c25d0f32a35c0525 (diff) |
iommu/iommu-debug: Do a software table walk if ATOS fails
It's hard to tell whether ATOS failed due to a misconfiguration in
hardware or software. Add a software table walk to help narrow down the
reasons for the failure. If the software walk succeeds then there's
something wrong in hardware. If the software walk fails then there's
something wrong in software.
CRs-Fixed: 1014916
Change-Id: I49dd61856ad08e1890791b3e5c180350a5eaa648
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
Diffstat (limited to 'drivers/iommu/iommu-debug.c')
-rw-r--r-- | drivers/iommu/iommu-debug.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/iommu/iommu-debug.c b/drivers/iommu/iommu-debug.c index 75fcde6e2c20..ef4d5c6bf49a 100644 --- a/drivers/iommu/iommu-debug.c +++ b/drivers/iommu/iommu-debug.c @@ -1667,10 +1667,14 @@ static ssize_t iommu_debug_atos_read(struct file *file, char __user *ubuf, memset(buf, 0, 100); phys = iommu_iova_to_phys_hard(ddev->domain, ddev->iova); - if (!phys) + if (!phys) { strlcpy(buf, "FAIL\n", 100); - else + phys = iommu_iova_to_phys(ddev->domain, ddev->iova); + dev_err(ddev->dev, "ATOS for %pa failed. Software walk returned: %pa\n", + &ddev->iova, &phys); + } else { snprintf(buf, 100, "%pa\n", &phys); + } buflen = strlen(buf); if (copy_to_user(ubuf, buf, buflen)) { |