summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorAdeel Raza <araza@nvidia.com>2015-06-25 18:40:12 -0400
committerAdeel Raza <araza@nvidia.com>2016-01-29 17:40:11 -0500
commitf0a9ce0469314711ddb5a8baf6bf88615b71c59e (patch)
tree8f09a553c123f3a5b1bb7c5dd7a260a1f363b894 /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parent9e02111a768ab631a6719c1eae8d7c03e6e89c23 (diff)
gpu: nvgpu: SM/TEX exception handling support
Add TEX exception handling support. Also make SM exception handler into a function pointer, which should allow different chips to implement their own SM exception handling routine. Bug 1635727 Bug 1637486 Change-Id: I429905726c1840c11e83780843d82729495dc6a5 Signed-off-by: Adeel Raza <araza@nvidia.com> Reviewed-on: http://git-master/r/935329
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 6e2ea548..542a6c02 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -3996,6 +3996,7 @@ static void gk20a_gr_enable_gpc_exceptions(struct gk20a *g)
3996 u32 tpc_mask; 3996 u32 tpc_mask;
3997 3997
3998 gk20a_writel(g, gr_gpcs_tpcs_tpccs_tpc_exception_en_r(), 3998 gk20a_writel(g, gr_gpcs_tpcs_tpccs_tpc_exception_en_r(),
3999 gr_gpcs_tpcs_tpccs_tpc_exception_en_tex_enabled_f() |
3999 gr_gpcs_tpcs_tpccs_tpc_exception_en_sm_enabled_f()); 4000 gr_gpcs_tpcs_tpccs_tpc_exception_en_sm_enabled_f());
4000 4001
4001 tpc_mask = 4002 tpc_mask =
@@ -5241,7 +5242,7 @@ u32 gk20a_mask_hww_warp_esr(u32 hww_warp_esr)
5241 return hww_warp_esr; 5242 return hww_warp_esr;
5242} 5243}
5243 5244
5244static int gk20a_gr_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, 5245int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc,
5245 bool *post_event, struct channel_gk20a *fault_ch) 5246 bool *post_event, struct channel_gk20a *fault_ch)
5246{ 5247{
5247 int ret = 0; 5248 int ret = 0;
@@ -5322,6 +5323,27 @@ static int gk20a_gr_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc,
5322 return ret; 5323 return ret;
5323} 5324}
5324 5325
5326int gr_gk20a_handle_tex_exception(struct gk20a *g, u32 gpc, u32 tpc,
5327 bool *post_event)
5328{
5329 int ret = 0;
5330 u32 offset = proj_gpc_stride_v() * gpc +
5331 proj_tpc_in_gpc_stride_v() * tpc;
5332 u32 esr;
5333
5334 gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "");
5335
5336 esr = gk20a_readl(g,
5337 gr_gpc0_tpc0_tex_m_hww_esr_r() + offset);
5338 gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "0x%08x", esr);
5339
5340 gk20a_writel(g,
5341 gr_gpc0_tpc0_tex_m_hww_esr_r() + offset,
5342 esr);
5343
5344 return ret;
5345}
5346
5325static int gk20a_gr_handle_tpc_exception(struct gk20a *g, u32 gpc, u32 tpc, 5347static int gk20a_gr_handle_tpc_exception(struct gk20a *g, u32 gpc, u32 tpc,
5326 bool *post_event, struct channel_gk20a *fault_ch) 5348 bool *post_event, struct channel_gk20a *fault_ch)
5327{ 5349{
@@ -5338,8 +5360,16 @@ static int gk20a_gr_handle_tpc_exception(struct gk20a *g, u32 gpc, u32 tpc,
5338 gr_gpc0_tpc0_tpccs_tpc_exception_sm_pending_v()) { 5360 gr_gpc0_tpc0_tpccs_tpc_exception_sm_pending_v()) {
5339 gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, 5361 gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg,
5340 "GPC%d TPC%d: SM exception pending", gpc, tpc); 5362 "GPC%d TPC%d: SM exception pending", gpc, tpc);
5341 ret = gk20a_gr_handle_sm_exception(g, gpc, tpc, 5363 ret = g->ops.gr.handle_sm_exception(g, gpc, tpc,
5342 post_event, fault_ch); 5364 post_event, fault_ch);
5365 }
5366
5367 /* check if a tex exeption is pending */
5368 if (gr_gpc0_tpc0_tpccs_tpc_exception_tex_v(tpc_exception) ==
5369 gr_gpc0_tpc0_tpccs_tpc_exception_tex_pending_v()) {
5370 gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg,
5371 "GPC%d TPC%d: TEX exception pending", gpc, tpc);
5372 ret = g->ops.gr.handle_tex_exception(g, gpc, tpc, post_event);
5343 } 5373 }
5344 5374
5345 return ret; 5375 return ret;
@@ -7595,4 +7625,6 @@ void gk20a_init_gr_ops(struct gpu_ops *gops)
7595 gops->gr.get_access_map = gr_gk20a_get_access_map; 7625 gops->gr.get_access_map = gr_gk20a_get_access_map;
7596 gops->gr.handle_fecs_error = gk20a_gr_handle_fecs_error; 7626 gops->gr.handle_fecs_error = gk20a_gr_handle_fecs_error;
7597 gops->gr.mask_hww_warp_esr = gk20a_mask_hww_warp_esr; 7627 gops->gr.mask_hww_warp_esr = gk20a_mask_hww_warp_esr;
7628 gops->gr.handle_sm_exception = gr_gk20a_handle_sm_exception;
7629 gops->gr.handle_tex_exception = gr_gk20a_handle_tex_exception;
7598} 7630}