mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
767700e13df25f9ab6a9b25d1aa1c353fb50376e
There is no point in managing iovad that's not binded to device's IOMMU domain. So this patch just removes iovad managing code and does a correct iommu_dma_alloc_iova() to reserve the iova. A difficulty of using iommu_dma_alloc_iova() is that we mostly do not use aligned addresses for the target iova, but IOMMU core aligns the iova address with the size by power of two due to cache friendly. So the trick here is to align the start address and to allocate a larger iova region that would cover the target iova -- the excessive part will be freed during iommu_dma_free_iova() by IOMMU core. Note that the dma_free_coherent() does both iommu_unmap and iommu_dma_free_iova, so there's no need of an extra free_iova() in the exit routine. However, for the remap part, the tmp_iova is allocated and mapped, so it should be unmapped and freed. So this patch also adds a free() of tmp_iova in the nvadsp_dma_alloc_at_map() function. Bug 200444660 Change-Id: I54126c2bd9ff3dd688aaa5c6f9befaad620ab548 Signed-off-by: Nicolin Chen <nicolinc@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2096704 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Description
No description provided