diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/fifo_gv11b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | 56 |
1 files changed, 1 insertions, 55 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c index 7e0bbf81..210a863b 100644 --- a/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | |||
@@ -951,52 +951,6 @@ static void gv11b_fifo_locked_preempt_runlists(struct gk20a *g, u32 runlists_mas | |||
951 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | 951 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); |
952 | } | 952 | } |
953 | 953 | ||
954 | static int __locked_fifo_preempt_ch_tsg(struct gk20a *g, u32 id, | ||
955 | unsigned int id_type) | ||
956 | { | ||
957 | int ret; | ||
958 | struct fifo_gk20a *f = &g->fifo; | ||
959 | |||
960 | nvgpu_log_fn(g, "id:%d id_type:%d", id, id_type); | ||
961 | |||
962 | /* Issue tsg preempt. Channel preempt is noop */ | ||
963 | if (id_type == ID_TYPE_CHANNEL) | ||
964 | gk20a_fifo_issue_preempt(g, f->channel[id].tsgid, true); | ||
965 | else | ||
966 | gk20a_fifo_issue_preempt(g, id, true); | ||
967 | |||
968 | /* wait for preempt */ | ||
969 | ret = g->ops.fifo.is_preempt_pending(g, id, id_type); | ||
970 | |||
971 | /* No recovery even if preempt timed out since | ||
972 | * this is called from recovery path | ||
973 | */ | ||
974 | |||
975 | return ret; | ||
976 | } | ||
977 | |||
978 | |||
979 | int gv11b_fifo_preempt_ch_tsg(struct gk20a *g, u32 id, | ||
980 | unsigned int id_type) | ||
981 | { | ||
982 | u32 ret = 0; | ||
983 | u32 token = PMU_INVALID_MUTEX_OWNER_ID; | ||
984 | u32 mutex_ret = 0; | ||
985 | |||
986 | mutex_ret = nvgpu_pmu_mutex_acquire(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | ||
987 | /* | ||
988 | * This is called from teardown path only. runlist_lock | ||
989 | * is already acquired before calling this function. | ||
990 | */ | ||
991 | ret = __locked_fifo_preempt_ch_tsg(g, id, id_type); | ||
992 | |||
993 | if (!mutex_ret) | ||
994 | nvgpu_pmu_mutex_release(&g->pmu, PMU_MUTEX_ID_FIFO, &token); | ||
995 | |||
996 | return ret; | ||
997 | |||
998 | } | ||
999 | |||
1000 | static void gv11b_fifo_locked_abort_runlist_active_tsgs(struct gk20a *g, | 954 | static void gv11b_fifo_locked_abort_runlist_active_tsgs(struct gk20a *g, |
1001 | unsigned int rc_type, | 955 | unsigned int rc_type, |
1002 | u32 runlists_mask) | 956 | u32 runlists_mask) |
@@ -1174,15 +1128,7 @@ void gv11b_fifo_teardown_ch_tsg(struct gk20a *g, u32 act_eng_bitmask, | |||
1174 | * that all PBDMAs serving the engine are not loaded when engine is | 1128 | * that all PBDMAs serving the engine are not loaded when engine is |
1175 | * reset. | 1129 | * reset. |
1176 | */ | 1130 | */ |
1177 | if (tsg) { | 1131 | gv11b_fifo_locked_preempt_runlists(g, runlists_mask); |
1178 | int preempt_failed; | ||
1179 | |||
1180 | preempt_failed = g->ops.fifo.preempt_ch_tsg(g, id, id_type); | ||
1181 | if (preempt_failed) | ||
1182 | gv11b_fifo_locked_preempt_runlists(g, runlists_mask); | ||
1183 | } else { | ||
1184 | gv11b_fifo_locked_preempt_runlists(g, runlists_mask); | ||
1185 | } | ||
1186 | 1132 | ||
1187 | /* check if engine reset should be deferred */ | 1133 | /* check if engine reset should be deferred */ |
1188 | for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { | 1134 | for (rlid = 0; rlid < g->fifo.max_runlists; rlid++) { |