gpu: nvgpu: Close channels before freeing them

Ensure that any open channel is definitely closed before freeing it.

Bug 1816516
Bug 1807277

Change-Id: I7f100db5ab6834176ec97d22374646d3336f2856
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1250023
(cherry picked from commit 56f1b4b4312c5900f1c27eba55ad970c4b264f24)
Reviewed-on: http://git-master/r/1261919
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2016-11-08 11:22:25 -08:00
committed by mobile promotions
parent c1be5105da
commit 1d8a77a7f9

View File

@@ -486,9 +486,24 @@ void gk20a_fifo_delete_runlist(struct fifo_gk20a *f)
static void gk20a_remove_fifo_support(struct fifo_gk20a *f)
{
struct gk20a *g = f->g;
unsigned int i = 0;
gk20a_dbg_fn("");
/*
* Make sure all channels are closed before deleting them.
*/
for (; i < f->num_channels; i++) {
struct channel_gk20a *c = f->channel + i;
/*
* Could race but worst that happens is we get an error message
* from gk20a_free_channel() complaining about multiple closes.
*/
if (c->referenceable)
__gk20a_channel_kill(c);
}
vfree(f->channel);
vfree(f->tsg);
if (g->ops.mm.is_bar1_supported(g))