From eb74267b833be530568625f5a1dcb248f0fcda1f Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 22 Oct 2014 17:39:42 +0300 Subject: gpu: nvgpu: free all vm's when removing support Remove both bar1 and pmu. Bug 1476801 Change-Id: I0c194db06b576083ddaab3726b8575ebce473d84 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/592114 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c') 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) return 0; } -static void gk20a_remove_mm_support(struct mm_gk20a *mm) +static void gk20a_remove_vm(struct vm_gk20a *vm, struct inst_desc *inst_block) { - struct gk20a *g = mm->g; + struct gk20a *g = vm->mm->g; struct device *d = dev_from_gk20a(g); - struct vm_gk20a *vm = &mm->bar1.vm; - struct inst_desc *inst_block = &mm->bar1.inst_block; gk20a_dbg_fn(""); @@ -283,6 +281,12 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) gk20a_vm_remove_support_nofree(vm); } +static void gk20a_remove_mm_support(struct mm_gk20a *mm) +{ + gk20a_remove_vm(&mm->bar1.vm, &mm->bar1.inst_block); + gk20a_remove_vm(&mm->pmu.vm, &mm->pmu.inst_block); +} + int gk20a_init_mm_setup_sw(struct gk20a *g) { struct mm_gk20a *mm = &g->mm; -- cgit v1.2.2