From 58fce99f7479d9ea1f8fcbc9be18f8cebd349ffb Mon Sep 17 00:00:00 2001 From: Omprakash Shewale Date: Tue, 11 Jan 2022 04:11:13 -0800 Subject: [PATCH] Revert "gpu: nvgpu: use nvmap exported APIs for dma_alloc|free_attrs on kstable" This reverts commit 4bf47b32fcbde18222f1f82d039a08591952d35a. JIRA LS-458 Bug 200754700 Change-Id: Icd4ea0ea16e3c3aa5e6d6620dababe2366f410ec Signed-off-by: Omprakash Shewale Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2652862 --- drivers/gpu/nvgpu/Makefile | 7 ------- drivers/gpu/nvgpu/Makefile.linux.configs | 7 ------- .../gpu/nvgpu/os/linux/platform_gk20a_tegra.c | 16 ---------------- 3 files changed, 30 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 2c1ca89c6..f362eda8c 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -42,13 +42,6 @@ ifeq ($(CONFIG_TEGRA_GK20A_NVHOST_HOST1X),y) ccflags-y += -I$(srctree.host1x)/include endif -# When using the upstream nvmap driver, the Makefile must define the -# srctree.nvmap path in order to find the necessary header files for -# the upstream nvmap driver. -ifeq ($(CONFIG_NVGPU_NVMAP_NEXT),y) -ccflags-y += -I$(srctree.nvmap)/include -endif - ifeq ($(CONFIG_NVGPU_DEBUGGER),y) ccflags-y += -DCONFIG_NVGPU_DEBUGGER ccflags-y += -DCONFIG_NVGPU_ENGINE_RESET diff --git a/drivers/gpu/nvgpu/Makefile.linux.configs b/drivers/gpu/nvgpu/Makefile.linux.configs index db36282b3..dd595522b 100644 --- a/drivers/gpu/nvgpu/Makefile.linux.configs +++ b/drivers/gpu/nvgpu/Makefile.linux.configs @@ -94,10 +94,6 @@ CONFIG_TEGRA_GK20A_NVHOST := y CONFIG_TEGRA_GK20A_NVHOST_HOST1X := y endif -ifdef CONFIG_TEGRA_NVMAP_NEXT -CONFIG_NVGPU_NVMAP_NEXT := y -endif - # Enable support for GPUs on PCIe bus. ifeq ($(CONFIG_PCI),y) # Support for NVGPU DGPU @@ -223,9 +219,6 @@ endif ifeq ($(CONFIG_TEGRA_GK20A_NVHOST_HOST1X),y) ccflags-y += -DCONFIG_TEGRA_GK20A_NVHOST_HOST1X endif -ifeq ($(CONFIG_NVGPU_NVMAP_NEXT),y) -ccflags-y += -DCONFIG_NVGPU_NVMAP_NEXT -endif ifeq ($(CONFIG_NVGPU_DGPU),y) ccflags-y += -DCONFIG_NVGPU_DGPU endif diff --git a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c index 62f25b538..0597e93be 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gk20a_tegra.c @@ -28,10 +28,6 @@ #include #endif -#if defined(CONFIG_NVGPU_NVMAP_NEXT) -#include -#endif - #ifdef CONFIG_NV_TEGRA_MC #include #endif /* CONFIG_NV_TEGRA_MC */ @@ -113,15 +109,9 @@ struct gk20a_emc_params { static void gk20a_tegra_secure_page_destroy(struct gk20a *g, struct secure_page_buffer *secure_buffer) { -#if defined(CONFIG_NVGPU_NVMAP_NEXT) - nvmap_dma_free_attrs(&tegra_vpr_dev, secure_buffer->size, - (void *)(uintptr_t)secure_buffer->phys, - secure_buffer->phys, DMA_ATTR_NO_KERNEL_MAPPING); -#else dma_free_attrs(&tegra_vpr_dev, secure_buffer->size, (void *)(uintptr_t)secure_buffer->phys, secure_buffer->phys, DMA_ATTR_NO_KERNEL_MAPPING); -#endif secure_buffer->destroy = NULL; } @@ -705,14 +695,8 @@ int gk20a_tegra_init_secure_alloc(struct gk20a_platform *platform) #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0) tegra_vpr_dev.coherent_dma_mask = DMA_BIT_MASK(32); #endif -#if defined(CONFIG_NVGPU_NVMAP_NEXT) - (void)nvmap_dma_alloc_attrs(&tegra_vpr_dev, - platform->secure_buffer_size, &iova, - GFP_KERNEL, DMA_ATTR_NO_KERNEL_MAPPING); -#else (void)dma_alloc_attrs(&tegra_vpr_dev, platform->secure_buffer_size, &iova, GFP_KERNEL, DMA_ATTR_NO_KERNEL_MAPPING); -#endif /* Some platforms disable VPR. In that case VPR allocations always * fail. Just disable VPR usage in nvgpu in that case. */ if (dma_mapping_error(&tegra_vpr_dev, iova)) {