From e04e73c580976445880283552535199a70a80ea4 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Mon, 23 Nov 2015 14:17:56 -0800 Subject: 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 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/836746 --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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) return 0; } -void gk20a_disable_channel(struct channel_gk20a *ch, - bool finish, - unsigned long finish_timeout) +void gk20a_disable_channel(struct channel_gk20a *ch) { - gk20a_dbg_fn(""); - - if (finish) { - int err = gk20a_channel_finish(ch, finish_timeout); - WARN_ON(err); - } - - /* disable the channel from hw and increment syncpoints */ gk20a_channel_abort(ch); - - gk20a_wait_channel_idle(ch); - - /* preempt the channel */ ch->g->ops.fifo.preempt_channel(ch->g, ch->hw_chid); - - /* remove channel from runlist */ channel_gk20a_update_runlist(ch, false); } @@ -769,9 +753,8 @@ static void gk20a_free_channel(struct channel_gk20a *ch) trace_gk20a_free_channel(ch->hw_chid); - /* prevent new kickoffs */ - ch->has_timedout = true; - wmb(); + /* abort channel and remove from runlist */ + gk20a_disable_channel(ch); /* wait until there's only our ref to the channel */ gk20a_wait_until_counter_is_N( @@ -830,8 +813,6 @@ static void gk20a_free_channel(struct channel_gk20a *ch) gk20a_dbg_info("freeing bound channel context, timeout=%ld", timeout); - gk20a_disable_channel(ch, !ch->has_timedout, timeout); - gk20a_free_error_notifiers(ch); /* release channel ctx */ -- cgit v1.2.2