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.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
index 9843c7de..30e03092 100644
--- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c
@@ -757,6 +757,9 @@ int gv11b_fifo_preempt_channel(struct gk20a *g, u32 chid)
757 struct fifo_gk20a *f = &g->fifo; 757 struct fifo_gk20a *f = &g->fifo;
758 u32 tsgid; 758 u32 tsgid;
759 759
760 if (chid == FIFO_INVAL_CHANNEL_ID)
761 return 0;
762
760 tsgid = f->channel[chid].tsgid; 763 tsgid = f->channel[chid].tsgid;
761 nvgpu_log_info(g, "chid:%d tsgid:%d", chid, tsgid); 764 nvgpu_log_info(g, "chid:%d tsgid:%d", chid, tsgid);
762 765
@@ -813,10 +816,14 @@ int gv11b_fifo_preempt_tsg(struct gk20a *g, u32 tsgid)
813 u32 mutex_ret = 0; 816 u32 mutex_ret = 0;
814 u32 runlist_id; 817 u32 runlist_id;
815 818
816 nvgpu_log_fn(g, "%d", tsgid); 819 nvgpu_log_fn(g, "tsgid: %d", tsgid);
820 if (tsgid == FIFO_INVAL_TSG_ID)
821 return 0;
817 822
818 runlist_id = f->tsg[tsgid].runlist_id; 823 runlist_id = f->tsg[tsgid].runlist_id;
819 nvgpu_log_fn(g, "runlist_id %d", runlist_id); 824 nvgpu_log_fn(g, "runlist_id: %d", runlist_id);
825 if (runlist_id == FIFO_INVAL_RUNLIST_ID)
826 return 0;
820 827
821 nvgpu_mutex_acquire(&f->runlist_info[runlist_id].runlist_lock); 828 nvgpu_mutex_acquire(&f->runlist_info[runlist_id].runlist_lock);
822 829
@@ -829,6 +836,9 @@ int gv11b_fifo_preempt_tsg(struct gk20a *g, u32 tsgid)
829 836
830 nvgpu_mutex_release(&f->runlist_info[runlist_id].runlist_lock); 837 nvgpu_mutex_release(&f->runlist_info[runlist_id].runlist_lock);
831 838
839 if (ret)
840 gk20a_fifo_preempt_timeout_rc(g, tsgid, true);
841
832 return ret; 842 return ret;
833} 843}
834 844
@@ -888,7 +898,7 @@ static int __locked_fifo_preempt_ch_tsg(struct gk20a *g, u32 id,
888 timeout_rc_type); 898 timeout_rc_type);
889 899
890 if (ret && (timeout_rc_type == PREEMPT_TIMEOUT_RC)) 900 if (ret && (timeout_rc_type == PREEMPT_TIMEOUT_RC))
891 __locked_fifo_preempt_timeout_rc(g, id, id_type); 901 gk20a_fifo_preempt_timeout_rc(g, id, id_type);
892 902
893 return ret; 903 return ret;
894} 904}