summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c25
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/vgpu/gr_vgpu.c6
4 files changed, 6 insertions, 35 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 */
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
index d3428788..cb8ffa95 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.h
@@ -194,9 +194,7 @@ void gk20a_channel_close(struct channel_gk20a *ch);
194 194
195bool gk20a_channel_update_and_check_timeout(struct channel_gk20a *ch, 195bool gk20a_channel_update_and_check_timeout(struct channel_gk20a *ch,
196 u32 timeout_delta_ms); 196 u32 timeout_delta_ms);
197void gk20a_disable_channel(struct channel_gk20a *ch, 197void gk20a_disable_channel(struct channel_gk20a *ch);
198 bool wait_for_finish,
199 unsigned long finish_timeout);
200void gk20a_channel_abort(struct channel_gk20a *ch); 198void gk20a_channel_abort(struct channel_gk20a *ch);
201int gk20a_channel_finish(struct channel_gk20a *ch, unsigned long timeout); 199int gk20a_channel_finish(struct channel_gk20a *ch, unsigned long timeout);
202void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error); 200void gk20a_set_error_notifier(struct channel_gk20a *ch, __u32 error);
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 34ad1771..ca44cf21 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2815,8 +2815,6 @@ out:
2815int gk20a_free_obj_ctx(struct channel_gk20a *c, 2815int gk20a_free_obj_ctx(struct channel_gk20a *c,
2816 struct nvgpu_free_obj_ctx_args *args) 2816 struct nvgpu_free_obj_ctx_args *args)
2817{ 2817{
2818 unsigned long timeout = gk20a_get_gr_idle_timeout(c->g);
2819
2820 gk20a_dbg_fn(""); 2818 gk20a_dbg_fn("");
2821 2819
2822 if (c->num_objects == 0) 2820 if (c->num_objects == 0)
@@ -2826,9 +2824,7 @@ int gk20a_free_obj_ctx(struct channel_gk20a *c,
2826 2824
2827 if (c->num_objects == 0) { 2825 if (c->num_objects == 0) {
2828 c->first_init = false; 2826 c->first_init = false;
2829 gk20a_disable_channel(c, 2827 gk20a_disable_channel(c);
2830 !c->has_timedout,
2831 timeout);
2832 gr_gk20a_free_channel_patch_ctx(c); 2828 gr_gk20a_free_channel_patch_ctx(c);
2833 } 2829 }
2834 2830
diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
index a4ec5254..d8da6f3f 100644
--- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c
@@ -527,8 +527,6 @@ out:
527static int vgpu_gr_free_obj_ctx(struct channel_gk20a *c, 527static int vgpu_gr_free_obj_ctx(struct channel_gk20a *c,
528 struct nvgpu_free_obj_ctx_args *args) 528 struct nvgpu_free_obj_ctx_args *args)
529{ 529{
530 unsigned long timeout = gk20a_get_gr_idle_timeout(c->g);
531
532 gk20a_dbg_fn(""); 530 gk20a_dbg_fn("");
533 531
534 if (c->num_objects == 0) 532 if (c->num_objects == 0)
@@ -538,9 +536,7 @@ static int vgpu_gr_free_obj_ctx(struct channel_gk20a *c,
538 536
539 if (c->num_objects == 0) { 537 if (c->num_objects == 0) {
540 c->first_init = false; 538 c->first_init = false;
541 gk20a_disable_channel(c, 539 gk20a_disable_channel(c);
542 !c->has_timedout,
543 timeout);
544 } 540 }
545 541
546 return 0; 542 return 0;