summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2014-10-22 10:39:42 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:12:05 -0400
commiteb74267b833be530568625f5a1dcb248f0fcda1f (patch)
treedec072281c68a051cf69f3eccf27f23bb3e14a7d /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent97e6847cb1f52fc59701dcc4d9e53caf3faacb64 (diff)
gpu: nvgpu: free all vm's when removing support
Remove both bar1 and pmu. Bug 1476801 Change-Id: I0c194db06b576083ddaab3726b8575ebce473d84 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/592114 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 8f2d4079..a390e36b 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -265,12 +265,10 @@ static int gk20a_init_mm_reset_enable_hw(struct gk20a *g)
265 return 0; 265 return 0;
266} 266}
267 267
268static void gk20a_remove_mm_support(struct mm_gk20a *mm) 268static void gk20a_remove_vm(struct vm_gk20a *vm, struct inst_desc *inst_block)
269{ 269{
270 struct gk20a *g = mm->g; 270 struct gk20a *g = vm->mm->g;
271 struct device *d = dev_from_gk20a(g); 271 struct device *d = dev_from_gk20a(g);
272 struct vm_gk20a *vm = &mm->bar1.vm;
273 struct inst_desc *inst_block = &mm->bar1.inst_block;
274 272
275 gk20a_dbg_fn(""); 273 gk20a_dbg_fn("");
276 274
@@ -283,6 +281,12 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm)
283 gk20a_vm_remove_support_nofree(vm); 281 gk20a_vm_remove_support_nofree(vm);
284} 282}
285 283
284static void gk20a_remove_mm_support(struct mm_gk20a *mm)
285{
286 gk20a_remove_vm(&mm->bar1.vm, &mm->bar1.inst_block);
287 gk20a_remove_vm(&mm->pmu.vm, &mm->pmu.inst_block);
288}
289
286int gk20a_init_mm_setup_sw(struct gk20a *g) 290int gk20a_init_mm_setup_sw(struct gk20a *g)
287{ 291{
288 struct mm_gk20a *mm = &g->mm; 292 struct mm_gk20a *mm = &g->mm;