diff options
author | Seema Khowala <seemaj@nvidia.com> | 2018-07-10 14:08:23 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-07-19 16:55:32 -0400 |
commit | 5ff1b3fe5a30c926e59a55ad25dd4daf430c8579 (patch) | |
tree | 358e0b2c57c89bd644a4ed1cbebba7ce4215909f /drivers/gpu/nvgpu/gv11b/fifo_gv11b.c | |
parent | a94dd24e262a7767684f051ee91b147d840bb8a0 (diff) |
gpu: nvgpu: gv11b: issue runlist preempt during teardown
-During teardown issue runlist preempt
-preempt_ch_tsg hal is removed as it is no more required.
This hal was added to be called from teardown so that if
there is preempt timeout, preempt timeout recovery is not
triggered.
Bug 200426402
Change-Id: I679e3306aa890ff0cfa211cfcc7d5405b7cb1211
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1775443
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
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++) { |