diff options
author | Hiroshi Doyu <hdoyu@nvidia.com> | 2013-05-20 09:16:26 +0300 |
---|---|---|
committer | Harshada Kale <hkale@nvidia.com> | 2013-06-10 03:53:13 -0700 |
commit | dbd73a44ba87b987d6adc9700a4f4d01de2cbd4d (patch) | |
tree | 1d88b122542d91fde3198bff831873ef2b35da32 /drivers/iommu | |
parent | 491950edf64c1360861194f67dfb7b7745276acb (diff) |
tegra/iommu: smmu: Add linear map support at unmap
Add linear map support at unmap
bug 1286500
Change-Id: I093ddf8ab6c72fd917107944edef3e465414e345
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/234139
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/tegra-smmu.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index 6795f3c3c137..5a77e74527b5 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -823,11 +823,17 @@ static size_t __smmu_iommu_unmap_pages(struct smmu_as *as, dma_addr_t iova, if (pte) { unsigned int *rest = &as->pte_count[pdn]; size_t bytes = sizeof(*pte) * count; + int i; - memset(pte, 0, bytes); - FLUSH_CPU_DCACHE(pte, page, bytes); + for (i = 0; i < count; i++) { + if (ptbl[ptn + i] == _PTE_VACANT(iova + i * PAGE_SIZE)) + continue; + + ptbl[ptn + i] = _PTE_VACANT(iova + i * PAGE_SIZE); + (*rest)--; + } - *rest -= count; + FLUSH_CPU_DCACHE(pte, page, bytes); if (!*rest) free_ptbl(as, iova, !flush_all); |