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 <alexw@nvidia.com>
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 <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2016-09-22 10:07:53 -07:00
committed by mobile promotions
parent f0fe1c2f02
commit 93eea1d729
3 changed files with 24 additions and 9 deletions

View File

@@ -696,6 +696,9 @@ void gk20a_remove_support(struct device *dev)
if (g->gr.remove_support)
g->gr.remove_support(&g->gr);
if (g->mm.remove_ce_support)
g->mm.remove_ce_support(&g->mm);
if (g->fifo.remove_support)
g->fifo.remove_support(&g->fifo);

View File

@@ -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;

View File

@@ -376,6 +376,11 @@ struct mm_gk20a {
#ifdef CONFIG_ARCH_TEGRA_18x_SOC
struct mem_desc bar2_desc;
#endif
/*
* Separate function to cleanup the CE since it requires a channel to
* be closed which must happen before fifo cleanup.
*/
void (*remove_ce_support)(struct mm_gk20a *mm);
void (*remove_support)(struct mm_gk20a *mm);
bool sw_ready;
int physical_bits;