From 9eebb7831facaa16b2975f50a716d2986c67b699 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 25 Oct 2017 14:17:30 -0700 Subject: gpu: nvgpu: Linux specific sm_error_state_record Create an nvgpu internal nvgpu_gr_sm_error_state to store and propagate SM error state within driver. Use nvgpu_dbg_gpu_sm_error_state_record only in Linux code. JIRA NVGPU-259 Change-Id: I7365cdf5a1a42cbcdb418dfcef3e0020e02a960f Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1585645 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 3 +-- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 4 ++-- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 10 +++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 13d534c4..80d85d65 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -361,8 +361,7 @@ struct gpu_ops { u32 gpc, u32 tpc); int (*update_sm_error_state)(struct gk20a *g, struct channel_gk20a *ch, u32 sm_id, - struct nvgpu_dbg_gpu_sm_error_state_record * - sm_error_state); + struct nvgpu_gr_sm_error_state *sm_error_state); int (*clear_sm_error_state)(struct gk20a *g, struct channel_gk20a *ch, u32 sm_id); int (*suspend_contexts)(struct gk20a *g, diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 5910c7d9..2fd6f72c 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -1543,7 +1543,7 @@ restore_fe_go_idle: * we initialize gr->no_of_sm in this function */ gr->sm_error_states = nvgpu_kzalloc(g, - sizeof(struct nvgpu_dbg_gpu_sm_error_state_record) + sizeof(struct nvgpu_gr_sm_error_state) * gr->no_of_sm); if (!gr->sm_error_states) { err = -ENOMEM; @@ -4566,7 +4566,7 @@ restore_fe_go_idle: * we initialize gr->no_of_sm in this function */ gr->sm_error_states = nvgpu_kzalloc(g, - sizeof(struct nvgpu_dbg_gpu_sm_error_state_record) * + sizeof(struct nvgpu_gr_sm_error_state) * gr->no_of_sm); if (!gr->sm_error_states) { err = -ENOMEM; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 6b422138..22fc40d1 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -231,6 +231,14 @@ struct nvgpu_preemption_modes_rec { u32 default_compute_preempt_mode; /* default mode */ }; +struct nvgpu_gr_sm_error_state { + u32 hww_global_esr; + u32 hww_warp_esr; + u64 hww_warp_esr_pc; + u32 hww_global_esr_report_mask; + u32 hww_warp_esr_report_mask; +}; + struct gr_gk20a { struct gk20a *g; struct { @@ -387,7 +395,7 @@ struct gr_gk20a { u32 *fbp_rop_l2_en_mask; u32 no_of_sm; struct sm_info *sm_to_cluster; - struct nvgpu_dbg_gpu_sm_error_state_record *sm_error_states; + struct nvgpu_gr_sm_error_state *sm_error_states; #if defined(CONFIG_GK20A_CYCLE_STATS) struct nvgpu_mutex cs_lock; struct gk20a_cs_snapshot *cs_data; -- cgit v1.2.2