From: Hiroshi DOYU <hdoyu@xxxxxxxxxx> No need to allocate new pte if it doesn't exsit just for translation. Signed-off-by: Hiroshi DOYU <hdoyu@xxxxxxxxxx> --- drivers/iommu/tegra-smmu.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index f7e9bf8..dee8f22 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -766,14 +766,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); -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-tegra" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html