From 93eea1d72934b28db4707e5aa7ab4dab65d89551 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 22 Sep 2016 10:07:53 -0700 Subject: gpu: nvgpu: Move CE cleanup Move the CE cleanup to before the FIFO cleanup. Since the CE closes a channel during its cleanup the FIFO needs to be initialized since the FIFO code maintains the vmalloc()'ed channels. Bug 1816516 Change-Id: Ia7a97059a12a0c2b52368ffe411e597f803e8e6e Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1225613 (cherry picked from commit 707bd2a6d4672c6a7b7a8b2e581ea3a606ed971d) Reviewed-on: http://git-master/r/1240106 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 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 944a5b13..079e42ba 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -784,11 +784,25 @@ static void gk20a_vidmem_destroy(struct gk20a *g) #endif } -static void gk20a_remove_mm_support(struct mm_gk20a *mm) +static void gk20a_remove_mm_ce_support(struct mm_gk20a *mm) { struct gk20a *g = gk20a_from_mm(mm); struct gk20a_platform *platform = gk20a_get_platform(g->dev); + if (mm->vidmem.ce_ctx_id != ~0) + gk20a_ce_delete_context(g->dev, mm->vidmem.ce_ctx_id); + + mm->vidmem.ce_ctx_id = ~0; + + if (platform->has_ce) + gk20a_vm_remove_support_nofree(&mm->ce.vm); + +} + +static void gk20a_remove_mm_support(struct mm_gk20a *mm) +{ + struct gk20a *g = gk20a_from_mm(mm); + if (g->ops.mm.remove_bar2_vm) g->ops.mm.remove_bar2_vm(g); @@ -799,14 +813,6 @@ static void gk20a_remove_mm_support(struct mm_gk20a *mm) gk20a_free_inst_block(gk20a_from_mm(mm), &mm->hwpm.inst_block); gk20a_vm_remove_support_nofree(&mm->cde.vm); - if (mm->vidmem.ce_ctx_id != ~0) - gk20a_ce_delete_context(g->dev, mm->vidmem.ce_ctx_id); - - mm->vidmem.ce_ctx_id = ~0; - - if (platform->has_ce) - gk20a_vm_remove_support_nofree(&mm->ce.vm); - gk20a_vidmem_destroy(g); } @@ -1034,6 +1040,7 @@ int gk20a_init_mm_setup_sw(struct gk20a *g) /* set vm_alloc_share op here as gk20a_as_alloc_share needs it */ g->ops.mm.vm_alloc_share = gk20a_vm_alloc_share; mm->remove_support = gk20a_remove_mm_support; + mm->remove_ce_support = gk20a_remove_mm_ce_support; mm->sw_ready = true; -- cgit v1.2.2