summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2016-11-08 14:22:25 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-12-19 18:40:14 -0500
commit1d8a77a7f9c7192db8562ecd303fe47c30bde3fd (patch)
treeca23274429845701ac2149f401b8ba12a7ba8abe /drivers/gpu/nvgpu/gk20a
parentc1be5105dadc864159c40bdf1548336ac6fab3f9 (diff)
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>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fifo_gk20a.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
index 99d5fd4c..1818a57e 100644
--- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c
@@ -486,9 +486,24 @@ void gk20a_fifo_delete_runlist(struct fifo_gk20a *f)
486static void gk20a_remove_fifo_support(struct fifo_gk20a *f) 486static void gk20a_remove_fifo_support(struct fifo_gk20a *f)
487{ 487{
488 struct gk20a *g = f->g; 488 struct gk20a *g = f->g;
489 unsigned int i = 0;
489 490
490 gk20a_dbg_fn(""); 491 gk20a_dbg_fn("");
491 492
493 /*
494 * Make sure all channels are closed before deleting them.
495 */
496 for (; i < f->num_channels; i++) {
497 struct channel_gk20a *c = f->channel + i;
498
499 /*
500 * Could race but worst that happens is we get an error message
501 * from gk20a_free_channel() complaining about multiple closes.
502 */
503 if (c->referenceable)
504 __gk20a_channel_kill(c);
505 }
506
492 vfree(f->channel); 507 vfree(f->channel);
493 vfree(f->tsg); 508 vfree(f->tsg);
494 if (g->ops.mm.is_bar1_supported(g)) 509 if (g->ops.mm.is_bar1_supported(g))