summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 42a807f6..6fe330c0 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -5518,11 +5518,6 @@ void gk20a_gr_clear_sm_hww(struct gk20a *g,
5518 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_f()); 5518 gr_gpc0_tpc0_sm_hww_warp_esr_error_none_f());
5519} 5519}
5520 5520
5521u32 gk20a_mask_hww_warp_esr(u32 hww_warp_esr)
5522{
5523 return hww_warp_esr;
5524}
5525
5526int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, u32 sm, 5521int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, u32 sm,
5527 bool *post_event, struct channel_gk20a *fault_ch, 5522 bool *post_event, struct channel_gk20a *fault_ch,
5528 u32 *hww_global_esr) 5523 u32 *hww_global_esr)
@@ -5549,8 +5544,7 @@ int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, u32 sm,
5549 5544
5550 global_esr = gk20a_readl(g, 5545 global_esr = gk20a_readl(g,
5551 gr_gpc0_tpc0_sm_hww_global_esr_r() + offset); 5546 gr_gpc0_tpc0_sm_hww_global_esr_r() + offset);
5552 warp_esr = gk20a_readl(g, gr_gpc0_tpc0_sm_hww_warp_esr_r() + offset); 5547 warp_esr = g->ops.gr.get_sm_hww_warp_esr(g, gpc, tpc, sm);
5553 warp_esr = g->ops.gr.mask_hww_warp_esr(warp_esr);
5554 5548
5555 if (!sm_debugger_attached) { 5549 if (!sm_debugger_attached) {
5556 nvgpu_err(g, "sm hww global %08x warp %08x", 5550 nvgpu_err(g, "sm hww global %08x warp %08x",
@@ -7941,6 +7935,8 @@ int gk20a_gr_wait_for_sm_lock_down(struct gk20a *g, u32 gpc, u32 tpc,
7941 u32 dbgr_status0 = 0, dbgr_control0 = 0; 7935 u32 dbgr_status0 = 0, dbgr_control0 = 0;
7942 u64 warps_valid = 0, warps_paused = 0, warps_trapped = 0; 7936 u64 warps_valid = 0, warps_paused = 0, warps_trapped = 0;
7943 struct nvgpu_timeout timeout; 7937 struct nvgpu_timeout timeout;
7938 u32 warp_esr;
7939 u32 sm = 0;
7944 7940
7945 gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, 7941 gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg,
7946 "GPC%d TPC%d: locking down SM", gpc, tpc); 7942 "GPC%d TPC%d: locking down SM", gpc, tpc);
@@ -7952,12 +7948,10 @@ int gk20a_gr_wait_for_sm_lock_down(struct gk20a *g, u32 gpc, u32 tpc,
7952 do { 7948 do {
7953 u32 global_esr = gk20a_readl(g, 7949 u32 global_esr = gk20a_readl(g,
7954 gr_gpc0_tpc0_sm_hww_global_esr_r() + offset); 7950 gr_gpc0_tpc0_sm_hww_global_esr_r() + offset);
7955 u32 warp_esr = gk20a_readl(g,
7956 gr_gpc0_tpc0_sm_hww_warp_esr_r() + offset);
7957 dbgr_status0 = gk20a_readl(g, 7951 dbgr_status0 = gk20a_readl(g,
7958 gr_gpc0_tpc0_sm_dbgr_status0_r() + offset); 7952 gr_gpc0_tpc0_sm_dbgr_status0_r() + offset);
7959 7953
7960 warp_esr = g->ops.gr.mask_hww_warp_esr(warp_esr); 7954 warp_esr = g->ops.gr.get_sm_hww_warp_esr(g, gpc, tpc, sm);
7961 7955
7962 locked_down = 7956 locked_down =
7963 (gr_gpc0_tpc0_sm_dbgr_status0_locked_down_v(dbgr_status0) == 7957 (gr_gpc0_tpc0_sm_dbgr_status0_locked_down_v(dbgr_status0) ==
@@ -8496,3 +8490,11 @@ u32 gr_gk20a_tpc_enabled_exceptions(struct gk20a *g)
8496 8490
8497 return tpc_exception_en; 8491 return tpc_exception_en;
8498} 8492}
8493
8494u32 gk20a_gr_get_sm_hww_warp_esr(struct gk20a *g, u32 gpc, u32 tpc, u32 sm)
8495{
8496 u32 offset = gk20a_gr_gpc_offset(g, gpc) + gk20a_gr_tpc_offset(g, tpc);
8497 u32 hww_warp_esr = gk20a_readl(g,
8498 gr_gpc0_tpc0_sm_hww_warp_esr_r() + offset);
8499 return hww_warp_esr;
8500}