diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 4dc19091..2b1013a0 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -6155,6 +6155,7 @@ int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, | |||
6155 | { | 6155 | { |
6156 | int ret = 0; | 6156 | int ret = 0; |
6157 | bool do_warp_sync = false, early_exit = false, ignore_debugger = false; | 6157 | bool do_warp_sync = false, early_exit = false, ignore_debugger = false; |
6158 | bool disable_sm_exceptions = true; | ||
6158 | u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE); | 6159 | u32 gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_GPC_STRIDE); |
6159 | u32 tpc_in_gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_TPC_IN_GPC_STRIDE); | 6160 | u32 tpc_in_gpc_stride = nvgpu_get_litter_value(g, GPU_LIT_TPC_IN_GPC_STRIDE); |
6160 | u32 offset = gpc_stride * gpc + tpc_in_gpc_stride * tpc; | 6161 | u32 offset = gpc_stride * gpc + tpc_in_gpc_stride * tpc; |
@@ -6209,9 +6210,17 @@ int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, | |||
6209 | return ret; | 6210 | return ret; |
6210 | } | 6211 | } |
6211 | 6212 | ||
6212 | /* if an sm debugger is attached, disable forwarding of tpc exceptions. | 6213 | /* |
6213 | * the debugger will reenable exceptions after servicing them. */ | 6214 | * Disable forwarding of tpc exceptions, |
6214 | if (!ignore_debugger && sm_debugger_attached) { | 6215 | * the debugger will reenable exceptions after servicing them. |
6216 | * | ||
6217 | * Do not disable exceptions if the only SM exception is BPT_INT | ||
6218 | */ | ||
6219 | if ((global_esr == gr_gpc0_tpc0_sm_hww_global_esr_bpt_int_pending_f()) | ||
6220 | && (warp_esr == 0)) | ||
6221 | disable_sm_exceptions = false; | ||
6222 | |||
6223 | if (!ignore_debugger && disable_sm_exceptions) { | ||
6215 | u32 tpc_exception_en = gk20a_readl(g, | 6224 | u32 tpc_exception_en = gk20a_readl(g, |
6216 | gr_gpc0_tpc0_tpccs_tpc_exception_en_r() + | 6225 | gr_gpc0_tpc0_tpccs_tpc_exception_en_r() + |
6217 | offset); | 6226 | offset); |
@@ -6219,11 +6228,11 @@ int gr_gk20a_handle_sm_exception(struct gk20a *g, u32 gpc, u32 tpc, | |||
6219 | gk20a_writel(g, | 6228 | gk20a_writel(g, |
6220 | gr_gpc0_tpc0_tpccs_tpc_exception_en_r() + offset, | 6229 | gr_gpc0_tpc0_tpccs_tpc_exception_en_r() + offset, |
6221 | tpc_exception_en); | 6230 | tpc_exception_en); |
6222 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "SM debugger attached"); | 6231 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "SM Exceptions disabled"); |
6223 | } | 6232 | } |
6224 | 6233 | ||
6225 | /* if a debugger is present and an error has occurred, do a warp sync */ | 6234 | /* if a debugger is present and an error has occurred, do a warp sync */ |
6226 | if (!ignore_debugger && sm_debugger_attached && | 6235 | if (!ignore_debugger && |
6227 | ((warp_esr != 0) || ((global_esr & ~global_mask) != 0))) { | 6236 | ((warp_esr != 0) || ((global_esr & ~global_mask) != 0))) { |
6228 | gk20a_dbg(gpu_dbg_intr, "warp sync needed"); | 6237 | gk20a_dbg(gpu_dbg_intr, "warp sync needed"); |
6229 | do_warp_sync = true; | 6238 | do_warp_sync = true; |