From e8d51f0c32708ce5b42660bce57bf715227e37d5 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 26 Jun 2018 13:10:12 +0300 Subject: gpu: nvgpu: remove nvgpu_mem_{begin,end}() The NVGPU_DMA_NO_KERNEL_MAPPING flag is going away, and these functions are no longer used. Delete them. Change-Id: I0084d64c92783dd65306871e5cf6bd6366087caf Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1761581 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/nvgpu_mem.c | 65 ---------------------------------- 1 file changed, 65 deletions(-) (limited to 'drivers/gpu/nvgpu/os/linux') diff --git a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c index 763d6506..04b2afa7 100644 --- a/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c +++ b/drivers/gpu/nvgpu/os/linux/nvgpu_mem.c @@ -48,71 +48,6 @@ static u64 __nvgpu_sgl_phys(struct gk20a *g, struct nvgpu_sgl *sgl) return ipa; } -int nvgpu_mem_begin(struct gk20a *g, struct nvgpu_mem *mem) -{ - void *cpu_va; - pgprot_t prot = nvgpu_is_enabled(g, NVGPU_USE_COHERENT_SYSMEM) ? - PAGE_KERNEL : - pgprot_writecombine(PAGE_KERNEL); - - if (mem->aperture != APERTURE_SYSMEM) - return 0; - - /* - * WAR for bug 2040115: we already will always have a coherent vmap() - * for all sysmem buffers. The prot settings are left alone since - * eventually this should be deleted. - */ - if (nvgpu_is_enabled(g, NVGPU_USE_COHERENT_SYSMEM)) - return 0; - - /* - * A CPU mapping is implicitly made for all SYSMEM DMA allocations that - * don't have NVGPU_DMA_NO_KERNEL_MAPPING. Thus we don't need to make - * another CPU mapping. - */ - if (!(mem->priv.flags & NVGPU_DMA_NO_KERNEL_MAPPING)) - return 0; - - if (WARN_ON(mem->cpu_va)) { - nvgpu_warn(g, "nested"); - return -EBUSY; - } - - cpu_va = vmap(mem->priv.pages, - PAGE_ALIGN(mem->size) >> PAGE_SHIFT, - 0, prot); - - if (WARN_ON(!cpu_va)) - return -ENOMEM; - - mem->cpu_va = cpu_va; - return 0; -} - -void nvgpu_mem_end(struct gk20a *g, struct nvgpu_mem *mem) -{ - if (mem->aperture != APERTURE_SYSMEM) - return; - - /* - * WAR for bug 2040115: skip this since the map will be taken care of - * during the free in the DMA API. - */ - if (nvgpu_is_enabled(g, NVGPU_USE_COHERENT_SYSMEM)) - return; - - /* - * Similar to nvgpu_mem_begin() we don't need to unmap the CPU mapping - * already made by the DMA API. - */ - if (!(mem->priv.flags & NVGPU_DMA_NO_KERNEL_MAPPING)) - return; - - vunmap(mem->cpu_va); - mem->cpu_va = NULL; -} - static void pramin_access_batch_rd_n(struct gk20a *g, u32 start, u32 words, u32 **arg) { struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); -- cgit v1.2.2