summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/fifo_gv11b.c35
1 files changed, 13 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 847bf172..90295f52 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -706,28 +706,13 @@ static int gv11b_fifo_is_preempt_pending(struct gk20a *g, u32 id,
706static int gv11b_fifo_preempt_channel(struct gk20a *g, u32 hw_chid) 706static int gv11b_fifo_preempt_channel(struct gk20a *g, u32 hw_chid)
707{ 707{
708 struct fifo_gk20a *f = &g->fifo; 708 struct fifo_gk20a *f = &g->fifo;
709 u32 ret = 0; 709 u32 tsgid;
710 u32 token = PMU_INVALID_MUTEX_OWNER_ID;
711 u32 mutex_ret = 0;
712 u32 runlist_id;
713
714 gk20a_dbg_fn("%d", hw_chid);
715
716 runlist_id = f->channel[hw_chid].runlist_id;
717 gk20a_dbg_fn("runlist_id %d", runlist_id);
718
719 nvgpu_mutex_acquire(&f->runlist_info[runlist_id].mutex);
720
721 mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token);
722
723 ret = __locked_fifo_preempt(g, hw_chid, false);
724
725 if (!mutex_ret)
726 nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token);
727 710
728 nvgpu_mutex_release(&f->runlist_info[runlist_id].mutex); 711 tsgid = f->channel[hw_chid].tsgid;
712 nvgpu_log_info(g, "chid:%d tsgid:%d", hw_chid, tsgid);
729 713
730 return ret; 714 /* Preempt tsg. Channel preempt is NOOP */
715 return g->ops.fifo.preempt_tsg(g, tsgid);
731} 716}
732 717
733static int __locked_fifo_preempt_runlists(struct gk20a *g, u32 runlists_mask) 718static int __locked_fifo_preempt_runlists(struct gk20a *g, u32 runlists_mask)
@@ -818,9 +803,15 @@ static int __locked_fifo_preempt_ch_tsg(struct gk20a *g, u32 id,
818 unsigned int id_type, unsigned int timeout_rc_type) 803 unsigned int id_type, unsigned int timeout_rc_type)
819{ 804{
820 int ret; 805 int ret;
806 struct fifo_gk20a *f = &g->fifo;
821 807
822 /* issue preempt */ 808 nvgpu_log_fn(g, "id:%d id_type:%d", id, id_type);
823 gk20a_fifo_issue_preempt(g, id, id_type); 809
810 /* Issue tsg preempt. Channel preempt is noop */
811 if (id_type == ID_TYPE_CHANNEL)
812 gk20a_fifo_issue_preempt(g, f->channel[id].tsgid, true);
813 else
814 gk20a_fifo_issue_preempt(g, id, true);
824 815
825 /* wait for preempt */ 816 /* wait for preempt */
826 ret = g->ops.fifo.is_preempt_pending(g, id, id_type, 817 ret = g->ops.fifo.is_preempt_pending(g, id, id_type,