diff options
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 10 |
1 files changed, 9 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 | ||
1067 | static int __exit gk20a_remove(struct platform_device *pdev) | 1075 | static int __exit gk20a_remove(struct platform_device *pdev) |