summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common')
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c10
-rw-r--r--drivers/gpu/nvgpu/common/mm/vm.c6
2 files changed, 15 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index ac64041e..52f987b2 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -25,6 +25,7 @@
25#include <linux/reset.h> 25#include <linux/reset.h>
26#include <linux/platform/tegra/common.h> 26#include <linux/platform/tegra/common.h>
27 27
28#include <nvgpu/dma.h>
28#include <nvgpu/kmem.h> 29#include <nvgpu/kmem.h>
29#include <nvgpu/nvgpu_common.h> 30#include <nvgpu/nvgpu_common.h>
30#include <nvgpu/soc.h> 31#include <nvgpu/soc.h>
@@ -1026,9 +1027,16 @@ int nvgpu_remove(struct device *dev, struct class *class)
1026 struct gk20a *g = get_gk20a(dev); 1027 struct gk20a *g = get_gk20a(dev);
1027 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); 1028 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
1028 struct gk20a_platform *platform = gk20a_get_platform(dev); 1029 struct gk20a_platform *platform = gk20a_get_platform(dev);
1030 int err;
1029 1031
1030 gk20a_dbg_fn(""); 1032 gk20a_dbg_fn("");
1031 1033
1034 err = nvgpu_quiesce(g);
1035 WARN(err, "gpu failed to idle during driver removal");
1036
1037 if (nvgpu_mem_is_valid(&g->syncpt_mem))
1038 nvgpu_dma_free(g, &g->syncpt_mem);
1039
1032 if (platform->has_cde) 1040 if (platform->has_cde)
1033 gk20a_cde_destroy(l); 1041 gk20a_cde_destroy(l);
1034 1042
@@ -1061,7 +1069,7 @@ int nvgpu_remove(struct device *dev, struct class *class)
1061 1069
1062 gk20a_dbg_fn("removed"); 1070 gk20a_dbg_fn("removed");
1063 1071
1064 return 0; 1072 return err;
1065} 1073}
1066 1074
1067static int __exit gk20a_remove(struct platform_device *pdev) 1075static int __exit gk20a_remove(struct platform_device *pdev)
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c
index 354d6ce4..f8d58349 100644
--- a/drivers/gpu/nvgpu/common/mm/vm.c
+++ b/drivers/gpu/nvgpu/common/mm/vm.c
@@ -527,6 +527,12 @@ static void __nvgpu_vm_remove(struct vm_gk20a *vm)
527 } 527 }
528 } 528 }
529 529
530#if defined(CONFIG_TEGRA_GK20A_NVHOST) && defined(CONFIG_TEGRA_19x_GPU)
531 if (nvgpu_mem_is_valid(&g->syncpt_mem) && vm->syncpt_ro_map_gpu_va)
532 nvgpu_gmmu_unmap(vm, &g->syncpt_mem,
533 vm->syncpt_ro_map_gpu_va);
534#endif
535
530 nvgpu_mutex_acquire(&vm->update_gmmu_lock); 536 nvgpu_mutex_acquire(&vm->update_gmmu_lock);
531 537
532 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers); 538 nvgpu_rbtree_enum_start(0, &node, vm->mapped_buffers);