summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-01-05 14:14:35 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-10 07:05:20 -0500
commita30f3075544b5edd2144383459d2650a88b1cde7 (patch)
tree7e0b21d9fecf8562993b3371736aa07757683886
parent98210aad81e2f89c2df2ed9b73ab9a96b4c85f41 (diff)
gpu: nvgpu: Free enabled flags on driver unload
Make sure the enabled flags are freed before the driver unloads. Bug 200369180 Change-Id: Ibac9ee61ca99bdfda03d76e393c7cd6cb6cc299a Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1632752 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/common/enabled.c8
-rw-r--r--drivers/gpu/nvgpu/common/linux/module.c2
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/enabled.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/enabled.c b/drivers/gpu/nvgpu/common/enabled.c
index 06cbbe34..cded36c8 100644
--- a/drivers/gpu/nvgpu/common/enabled.c
+++ b/drivers/gpu/nvgpu/common/enabled.c
@@ -40,6 +40,14 @@ int nvgpu_init_enabled_flags(struct gk20a *g)
40 return 0; 40 return 0;
41} 41}
42 42
43/*
44 * Call this on driver shutdown!
45 */
46void nvgpu_free_enabled_flags(struct gk20a *g)
47{
48 nvgpu_kfree(g, g->enabled_flags);
49}
50
43bool nvgpu_is_enabled(struct gk20a *g, int flag) 51bool nvgpu_is_enabled(struct gk20a *g, int flag)
44{ 52{
45 return test_bit(flag, g->enabled_flags); 53 return test_bit(flag, g->enabled_flags);
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c
index 5d91da8f..cc2b5ec7 100644
--- a/drivers/gpu/nvgpu/common/linux/module.c
+++ b/drivers/gpu/nvgpu/common/linux/module.c
@@ -673,6 +673,8 @@ void gk20a_remove_support(struct gk20a *g)
673#ifdef CONFIG_TEGRA_19x_GPU 673#ifdef CONFIG_TEGRA_19x_GPU
674 t19x_remove_support(g); 674 t19x_remove_support(g);
675#endif 675#endif
676
677 nvgpu_free_enabled_flags(g);
676} 678}
677 679
678static int gk20a_init_support(struct platform_device *dev) 680static int gk20a_init_support(struct platform_device *dev)
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
index e7dd61d2..001cafb0 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
@@ -170,5 +170,6 @@ bool nvgpu_is_enabled(struct gk20a *g, int flag);
170bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state); 170bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state);
171 171
172int nvgpu_init_enabled_flags(struct gk20a *g); 172int nvgpu_init_enabled_flags(struct gk20a *g);
173void nvgpu_free_enabled_flags(struct gk20a *g);
173 174
174#endif 175#endif