• Russell King's avatar
    iommu/tegra-smmu: Fix page table lookup in unmap/iova_to_phys methods · 0b42c7c1
    Russell King authored
    Fix the page table lookup in the unmap and iova_to_phys methods.
    Neither of these methods should allocate a page table; a missing page
    table should be treated the same as no mapping present.
    
    More importantly, using as_get_pte() for an IOVA corresponding with a
    non-present page table entry increments the use-count for the page
    table, on the assumption that the caller of as_get_pte() is going to
    setup a mapping.  This is an incorrect assumption.
    
    Fix both of these bugs by providing a separate helper which only looks
    up the page table, but never allocates it.  This is akin to pte_offset()
    for CPU page tables.
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
    0b42c7c1
tegra-smmu.c 20.6 KB