summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSeema Khowala <seemaj@nvidia.com>2017-03-17 14:32:41 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-23 20:18:52 -0400
commite1cad55e529aa44d1d3646de83e563e037d80b67 (patch)
tree36ab58e1203a27a69d05fe5a49b3bc6e7ccafe6b /drivers/gpu
parent40d2f609032a5b492decd0da4c5f50e00f765f37 (diff)
gpu: nvgpu: gv11b: null check for fault_ch
gk20a_gr_get_channel_from_ctx() could return NULL as a result fault_ch could be null JIRA GPUT19X-7 Change-Id: If89507d3d3fa5a95ba75c4a90eb212d0c8b2214a Signed-off-by: Seema Khowala <seemaj@nvidia.com> Reviewed-on: http://git-master/r/1323255 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
index fabc6819..d109dbf8 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c
@@ -1413,8 +1413,7 @@ static int gr_gv11b_pre_process_sm_exception(struct gk20a *g,
1413 bool *early_exit, bool *ignore_debugger) 1413 bool *early_exit, bool *ignore_debugger)
1414{ 1414{
1415 int ret; 1415 int ret;
1416 bool cilp_enabled = (fault_ch->ch_ctx.gr_ctx->compute_preempt_mode == 1416 bool cilp_enabled = false;
1417 NVGPU_COMPUTE_PREEMPTION_MODE_CILP) ;
1418 u32 global_mask = 0, dbgr_control0, global_esr_copy; 1417 u32 global_mask = 0, dbgr_control0, global_esr_copy;
1419 u32 offset = proj_gpc_stride_v() * gpc + 1418 u32 offset = proj_gpc_stride_v() * gpc +
1420 proj_tpc_in_gpc_stride_v() * tpc; 1419 proj_tpc_in_gpc_stride_v() * tpc;
@@ -1422,6 +1421,10 @@ static int gr_gv11b_pre_process_sm_exception(struct gk20a *g,
1422 *early_exit = false; 1421 *early_exit = false;
1423 *ignore_debugger = false; 1422 *ignore_debugger = false;
1424 1423
1424 if (fault_ch)
1425 cilp_enabled = (fault_ch->ch_ctx.gr_ctx->compute_preempt_mode ==
1426 NVGPU_COMPUTE_PREEMPTION_MODE_CILP);
1427
1425 gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "SM Exception received on gpc %d tpc %d = %u\n", 1428 gk20a_dbg(gpu_dbg_fn | gpu_dbg_gpu_dbg, "SM Exception received on gpc %d tpc %d = %u\n",
1426 gpc, tpc, global_esr); 1429 gpc, tpc, global_esr);
1427 1430