mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: detect iommu'ability dynamically
A device can be iommu'able whenever it's registered so that this patch detects its iommu'ability dynamically. Bug 1577389 Change-Id: I8ea20e5dd997fc1a399f517c17783323f238ecc3 Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com> Reviewed-on: http://git-master/r/606019 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
committed by
Dan Willemsen
parent
8af8c35741
commit
75af9eb590
@@ -1664,14 +1664,16 @@ u64 gk20a_mm_smmu_vaddr_translate(struct gk20a *g, dma_addr_t iova)
|
||||
|
||||
u64 gk20a_mm_iova_addr(struct gk20a *g, struct scatterlist *sgl)
|
||||
{
|
||||
u64 result = sg_phys(sgl);
|
||||
#ifdef CONFIG_TEGRA_IOMMU_SMMU
|
||||
if (!device_is_iommuable(dev_from_gk20a(g)))
|
||||
return sg_phys(sgl);
|
||||
|
||||
if (sg_dma_address(sgl) == 0)
|
||||
return sg_phys(sgl);
|
||||
|
||||
if (sg_dma_address(sgl) == DMA_ERROR_CODE)
|
||||
result = 0;
|
||||
else if (sg_dma_address(sgl))
|
||||
result = gk20a_mm_smmu_vaddr_translate(g, sg_dma_address(sgl));
|
||||
#endif
|
||||
return result;
|
||||
return 0;
|
||||
|
||||
return gk20a_mm_smmu_vaddr_translate(g, sg_dma_address(sgl));
|
||||
}
|
||||
|
||||
static int update_gmmu_ptes_locked(struct vm_gk20a *vm,
|
||||
|
||||
Reference in New Issue
Block a user