summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
authorLakshmanan M <lm@nvidia.com>2017-05-19 06:13:13 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-05-19 12:44:30 -0400
commitdcb744acfbbc11e66cac2d0a674a42e62d908b9d (patch)
treed8f0cf97fbbe4acd8e68a79669588b5457faa1db /drivers/gpu/nvgpu
parentd85aa0064b3e9e1de3f2583499963977286b0d25 (diff)
gpu: nvgpu: Add GCC exception handling support
Add support for per-chip handling of GCC exception. JIRA GPUT19X-86 Change-Id: I76ea588dc76b5c821ae5b53529db6dd64b3a856a Signed-off-by: Lakshmanan M <lm@nvidia.com> Reviewed-on: http://git-master/r/1485836 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h3
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c9
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm206/hw_gr_gm206.h4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h4
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h4
7 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index af40c969..9ab0d202 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -304,6 +304,9 @@ struct gpu_ops {
304 int (*handle_sm_exception)(struct gk20a *g, u32 gpc, u32 tpc, 304 int (*handle_sm_exception)(struct gk20a *g, u32 gpc, u32 tpc,
305 bool *post_event, struct channel_gk20a *fault_ch, 305 bool *post_event, struct channel_gk20a *fault_ch,
306 u32 *hww_global_esr); 306 u32 *hww_global_esr);
307 int (*handle_gcc_exception)(struct gk20a *g, u32 gpc, u32 tpc,
308 bool *post_event, struct channel_gk20a *fault_ch,
309 u32 *hww_global_esr);
307 int (*handle_tex_exception)(struct gk20a *g, u32 gpc, u32 tpc, 310 int (*handle_tex_exception)(struct gk20a *g, u32 gpc, u32 tpc,
308 bool *post_event); 311 bool *post_event);
309 void (*enable_gpc_exceptions)(struct gk20a *g); 312 void (*enable_gpc_exceptions)(struct gk20a *g);
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 3486076e..4d41f9ff 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -6348,6 +6348,15 @@ static int gk20a_gr_handle_gpc_exception(struct gk20a *g, bool *post_event,
6348 * exceptions to be cleared */ 6348 * exceptions to be cleared */
6349 gk20a_gr_clear_sm_hww(g, gpc, tpc, global_esr); 6349 gk20a_gr_clear_sm_hww(g, gpc, tpc, global_esr);
6350 } 6350 }
6351
6352 /* Handle GCC exception */
6353 if(gr_gpc0_gpccs_gpc_exception_gcc_v(gpc_exception) &&
6354 g->ops.gr.handle_gcc_exception) {
6355 int gcc_ret = 0;
6356 gcc_ret = g->ops.gr.handle_gcc_exception(g, gpc, tpc,
6357 post_event, fault_ch, hww_global_esr);
6358 ret = ret ? ret : gcc_ret;
6359 }
6351 } 6360 }
6352 6361
6353 return ret; 6362 return ret;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h
index 7f6f58f3..455eef90 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gk20a/hw_gr_gk20a.h
@@ -3066,6 +3066,10 @@ static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3066{ 3066{
3067 return 0x00502c90; 3067 return 0x00502c90;
3068} 3068}
3069static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3070{
3071 return (r >> 2) & 0x1;
3072}
3069static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r) 3073static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3070{ 3074{
3071 return (r >> 16) & 0xff; 3075 return (r >> 16) & 0xff;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm206/hw_gr_gm206.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm206/hw_gr_gm206.h
index f0dea40a..34c46855 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gm206/hw_gr_gm206.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm206/hw_gr_gm206.h
@@ -3078,6 +3078,10 @@ static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3078{ 3078{
3079 return 0x00502c90; 3079 return 0x00502c90;
3080} 3080}
3081static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3082{
3083 return (r >> 2) & 0x1;
3084}
3081static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r) 3085static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3082{ 3086{
3083 return (r >> 16) & 0xff; 3087 return (r >> 16) & 0xff;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h
index bc966416..b6f0d047 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gm20b/hw_gr_gm20b.h
@@ -3138,6 +3138,10 @@ static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3138{ 3138{
3139 return 0x00502c90; 3139 return 0x00502c90;
3140} 3140}
3141static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3142{
3143 return (r >> 2) & 0x1;
3144}
3141static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r) 3145static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3142{ 3146{
3143 return (r >> 16) & 0xff; 3147 return (r >> 16) & 0xff;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h
index c6490f7a..9b5a475e 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp106/hw_gr_gp106.h
@@ -3382,6 +3382,10 @@ static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3382{ 3382{
3383 return 0x00502c90; 3383 return 0x00502c90;
3384} 3384}
3385static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3386{
3387 return (r >> 2) & 0x1;
3388}
3385static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r) 3389static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3386{ 3390{
3387 return (r >> 16) & 0xff; 3391 return (r >> 16) & 0xff;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h
index 43591166..4a87a629 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/hw/gp10b/hw_gr_gp10b.h
@@ -3502,6 +3502,10 @@ static inline u32 gr_gpc0_gpccs_gpc_exception_r(void)
3502{ 3502{
3503 return 0x00502c90; 3503 return 0x00502c90;
3504} 3504}
3505static inline u32 gr_gpc0_gpccs_gpc_exception_gcc_v(u32 r)
3506{
3507 return (r >> 2) & 0x1;
3508}
3505static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r) 3509static inline u32 gr_gpc0_gpccs_gpc_exception_tpc_v(u32 r)
3506{ 3510{
3507 return (r >> 16) & 0xff; 3511 return (r >> 16) & 0xff;