summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-11-23 17:17:56 -0500
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-12-10 11:38:20 -0500
commite04e73c580976445880283552535199a70a80ea4 (patch)
tree0c14150c32bb628503e32b3860e6975c3976a73e /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parenteb81d7d7e1d4a34ecd5968b13636f2c0e7a0dce1 (diff)
gpu: nvgpu: Immediate channel release
When closing channel, disable and preempt it immediately instead of waiting for it to finish all work. Bug 1683059 Change-Id: Ia5f5fc6a072dc3ddb1e9bf63534814ff0a60b5b4 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/836746
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 98c8760e..cd05691a 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -453,26 +453,10 @@ int gk20a_wait_channel_idle(struct channel_gk20a *ch)
453 return 0; 453 return 0;
454} 454}
455 455
456void gk20a_disable_channel(struct channel_gk20a *ch, 456void gk20a_disable_channel(struct channel_gk20a *ch)
457 bool finish,
458 unsigned long finish_timeout)
459{ 457{
460 gk20a_dbg_fn("");
461
462 if (finish) {
463 int err = gk20a_channel_finish(ch, finish_timeout);
464 WARN_ON(err);
465 }
466
467 /* disable the channel from hw and increment syncpoints */
468 gk20a_channel_abort(ch); 458 gk20a_channel_abort(ch);
469
470 gk20a_wait_channel_idle(ch);
471
472 /* preempt the channel */
473 ch->g->ops.fifo.preempt_channel(ch->g, ch->hw_chid); 459 ch->g->ops.fifo.preempt_channel(ch->g, ch->hw_chid);
474
475 /* remove channel from runlist */
476 channel_gk20a_update_runlist(ch, false); 460 channel_gk20a_update_runlist(ch, false);
477} 461}
478 462
@@ -769,9 +753,8 @@ static void gk20a_free_channel(struct channel_gk20a *ch)
769 753
770 trace_gk20a_free_channel(ch->hw_chid); 754 trace_gk20a_free_channel(ch->hw_chid);
771 755
772 /* prevent new kickoffs */ 756 /* abort channel and remove from runlist */
773 ch->has_timedout = true; 757 gk20a_disable_channel(ch);
774 wmb();
775 758
776 /* wait until there's only our ref to the channel */ 759 /* wait until there's only our ref to the channel */
777 gk20a_wait_until_counter_is_N( 760 gk20a_wait_until_counter_is_N(
@@ -830,8 +813,6 @@ static void gk20a_free_channel(struct channel_gk20a *ch)
830 gk20a_dbg_info("freeing bound channel context, timeout=%ld", 813 gk20a_dbg_info("freeing bound channel context, timeout=%ld",
831 timeout); 814 timeout);
832 815
833 gk20a_disable_channel(ch, !ch->has_timedout, timeout);
834
835 gk20a_free_error_notifiers(ch); 816 gk20a_free_error_notifiers(ch);
836 817
837 /* release channel ctx */ 818 /* release channel ctx */