summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c90
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.h3
-rw-r--r--drivers/gpu/nvgpu/gv11b/hal_gv11b.c1
3 files changed, 0 insertions, 94 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index 78cb1b98..3dedc6b5 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -3228,96 +3228,6 @@ void gv11b_gr_bpt_reg_info(struct gk20a *g, struct nvgpu_warpstate *w_state)
3228 } 3228 }
3229} 3229}
3230 3230
3231static void gv11b_gr_write_sm_error_state(struct gk20a *g,
3232 u32 offset,
3233 struct nvgpu_tsg_sm_error_state *sm_error_states)
3234{
3235 nvgpu_writel(g,
3236 gr_gpc0_tpc0_sm0_hww_global_esr_r() + offset,
3237 sm_error_states->hww_global_esr);
3238 nvgpu_writel(g,
3239 gr_gpc0_tpc0_sm0_hww_warp_esr_r() + offset,
3240 sm_error_states->hww_warp_esr);
3241 nvgpu_writel(g,
3242 gr_gpc0_tpc0_sm0_hww_warp_esr_pc_r() + offset,
3243 u64_lo32(sm_error_states->hww_warp_esr_pc));
3244 nvgpu_writel(g,
3245 gr_gpc0_tpc0_sm0_hww_warp_esr_pc_hi_r() + offset,
3246 u64_hi32(sm_error_states->hww_warp_esr_pc));
3247 nvgpu_writel(g,
3248 gr_gpc0_tpc0_sm0_hww_global_esr_report_mask_r() + offset,
3249 sm_error_states->hww_global_esr_report_mask);
3250 nvgpu_writel(g,
3251 gr_gpc0_tpc0_sm0_hww_warp_esr_report_mask_r() + offset,
3252 sm_error_states->hww_warp_esr_report_mask);
3253}
3254
3255int gv11b_gr_update_sm_error_state(struct gk20a *g,
3256 struct channel_gk20a *ch, u32 sm_id,
3257 struct nvgpu_tsg_sm_error_state *sm_error_state)
3258{
3259 struct tsg_gk20a *tsg;
3260 u32 gpc, tpc, sm, offset;
3261 struct nvgpu_gr_ctx *ch_ctx;
3262 int err = 0;
3263 struct nvgpu_tsg_sm_error_state *tsg_sm_error_states;
3264
3265 tsg = tsg_gk20a_from_ch(ch);
3266 if (tsg == NULL) {
3267 return -EINVAL;
3268 }
3269
3270 ch_ctx = &tsg->gr_ctx;
3271
3272 nvgpu_mutex_acquire(&g->dbg_sessions_lock);
3273
3274 tsg_sm_error_states = tsg->sm_error_states + sm_id;
3275 gk20a_tsg_update_sm_error_state_locked(tsg, sm_id, sm_error_state);
3276
3277 err = gr_gk20a_disable_ctxsw(g);
3278 if (err) {
3279 nvgpu_err(g, "unable to stop gr ctxsw");
3280 goto fail;
3281 }
3282
3283 gpc = g->gr.sm_to_cluster[sm_id].gpc_index;
3284 tpc = g->gr.sm_to_cluster[sm_id].tpc_index;
3285 sm = g->gr.sm_to_cluster[sm_id].sm_index;
3286
3287 offset = gk20a_gr_gpc_offset(g, gpc) +
3288 gk20a_gr_tpc_offset(g, tpc) +
3289 gv11b_gr_sm_offset(g, sm);
3290
3291 if (gk20a_is_channel_ctx_resident(ch)) {
3292 gv11b_gr_write_sm_error_state(g, offset, tsg_sm_error_states);
3293 } else {
3294 err = gr_gk20a_ctx_patch_write_begin(g, ch_ctx, false);
3295 if (err) {
3296 goto enable_ctxsw;
3297 }
3298
3299 gr_gk20a_ctx_patch_write(g, ch_ctx,
3300 gr_gpcs_tpcs_sms_hww_global_esr_report_mask_r() +
3301 offset,
3302 tsg_sm_error_states->hww_global_esr_report_mask,
3303 true);
3304 gr_gk20a_ctx_patch_write(g, ch_ctx,
3305 gr_gpcs_tpcs_sms_hww_warp_esr_report_mask_r() +
3306 offset,
3307 tsg_sm_error_states->hww_warp_esr_report_mask,
3308 true);
3309
3310 gr_gk20a_ctx_patch_write_end(g, ch_ctx, false);
3311 }
3312
3313enable_ctxsw:
3314 err = gr_gk20a_enable_ctxsw(g);
3315
3316fail:
3317 nvgpu_mutex_release(&g->dbg_sessions_lock);
3318 return err;
3319}
3320
3321int gv11b_gr_set_sm_debug_mode(struct gk20a *g, 3231int gv11b_gr_set_sm_debug_mode(struct gk20a *g,
3322 struct channel_gk20a *ch, u64 sms, bool enable) 3232 struct channel_gk20a *ch, u64 sms, bool enable)
3323{ 3233{
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
index a4b8fa91..20377acf 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
@@ -166,9 +166,6 @@ void gv11b_gr_get_esr_sm_sel(struct gk20a *g, u32 gpc, u32 tpc,
166 u32 *esr_sm_sel); 166 u32 *esr_sm_sel);
167int gv11b_gr_sm_trigger_suspend(struct gk20a *g); 167int gv11b_gr_sm_trigger_suspend(struct gk20a *g);
168void gv11b_gr_bpt_reg_info(struct gk20a *g, struct nvgpu_warpstate *w_state); 168void gv11b_gr_bpt_reg_info(struct gk20a *g, struct nvgpu_warpstate *w_state);
169int gv11b_gr_update_sm_error_state(struct gk20a *g,
170 struct channel_gk20a *ch, u32 sm_id,
171 struct nvgpu_tsg_sm_error_state *sm_error_state);
172int gv11b_gr_set_sm_debug_mode(struct gk20a *g, 169int gv11b_gr_set_sm_debug_mode(struct gk20a *g,
173 struct channel_gk20a *ch, u64 sms, bool enable); 170 struct channel_gk20a *ch, u64 sms, bool enable);
174int gv11b_gr_record_sm_error_state(struct gk20a *g, u32 gpc, u32 tpc, u32 sm, 171int gv11b_gr_record_sm_error_state(struct gk20a *g, u32 gpc, u32 tpc, u32 sm,
diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
index 479b06d1..591a7786 100644
--- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c
@@ -329,7 +329,6 @@ static const struct gpu_ops gv11b_ops = {
329 .update_smpc_ctxsw_mode = gr_gk20a_update_smpc_ctxsw_mode, 329 .update_smpc_ctxsw_mode = gr_gk20a_update_smpc_ctxsw_mode,
330 .update_hwpm_ctxsw_mode = gr_gk20a_update_hwpm_ctxsw_mode, 330 .update_hwpm_ctxsw_mode = gr_gk20a_update_hwpm_ctxsw_mode,
331 .record_sm_error_state = gv11b_gr_record_sm_error_state, 331 .record_sm_error_state = gv11b_gr_record_sm_error_state,
332 .update_sm_error_state = gv11b_gr_update_sm_error_state,
333 .clear_sm_error_state = gm20b_gr_clear_sm_error_state, 332 .clear_sm_error_state = gm20b_gr_clear_sm_error_state,
334 .suspend_contexts = gr_gp10b_suspend_contexts, 333 .suspend_contexts = gr_gp10b_suspend_contexts,
335 .resume_contexts = gr_gk20a_resume_contexts, 334 .resume_contexts = gr_gk20a_resume_contexts,