summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorHiroshi DOYU <hdoyu@nvidia.com>2012-03-23 10:56:41 +0200
committerVarun Colbert <vcolbert@nvidia.com>2012-08-09 20:52:52 -0700
commit524125b96d352a94e170883378dee5b651b74e58 (patch)
tree4d7fc80eba5ee1ccb87eaefa1ae13c6f82732401 /drivers/iommu
parent2e5fa35505771d19f1f43cfaf834d3d690d351c2 (diff)
iommu/tegra: smmu: Don't allocate pte at iova_to_phys
No need to allocate new pte if it doesn't exsit just for translation. Change-Id: I48ef9b48bc5d1d9b1ec73dca7db018df789e3232 Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/121261 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/tegra-smmu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index d85831b3dce8..5d2dc7916bda 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -721,14 +721,14 @@ static phys_addr_t smmu_iommu_iova_to_phys(struct iommu_domain *domain,
unsigned long *pte;
unsigned int *count;
struct page *page;
- unsigned long pfn;
+ unsigned long pfn = 0;
unsigned long flags;
spin_lock_irqsave(&as->lock, flags);
- pte = locate_pte(as, iova, true, &page, &count);
- pfn = *pte & SMMU_PFN_MASK;
- WARN_ON(!pfn_valid(pfn));
+ pte = locate_pte(as, iova, false, &page, &count);
+ if (pte)
+ pfn = *pte & SMMU_PFN_MASK;
dev_dbg(as->smmu->dev,
"iova:%08lx pfn:%08lx asid:%d\n", iova, pfn, as->asid);