iommu/tegra-smmu: Fix page table lookup in unmap/iova_to_phys methods
authorRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 27 Jul 2015 12:29:21 +0000 (13:29 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 13 Aug 2015 14:06:39 +0000 (16:06 +0200)
commit0b42c7c1132f331fba263f0d2ca23544770584b7
tree70277b41ac6145870f6e4f3640bb36151eba9da7
parent34d35f8cbe51bf93faf3214ee5b5d6f8ae7df4c1
iommu/tegra-smmu: Fix page table lookup in unmap/iova_to_phys methods

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: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/iommu/tegra-smmu.c
This page took 0.025522 seconds and 5 git commands to generate.