From bfe65407bde2b5d0776724301e215c6553c989f3 Mon Sep 17 00:00:00 2001 From: Vinod G Date: Tue, 7 Aug 2018 23:09:30 -0700 Subject: gpu: nvgpu: Read sm error ioctl support for tsg Add READ_SM_ERROR IOCTL support to TSG level. Moved the struct to save the sm_error details from gr to tsg as the sm_error support is context based, not global. Also corrected MISRA 21.1 error in header file. nvgpu_dbg_gpu_ioctl_write_single_sm_error_state and nvgpu_dbg_gpu_ioctl_read_single_sm_error_state functions are modified to use the tsg struct nvgpu_tsg_sm_error_state. Bug 200412642 Change-Id: I9e334b059078a4bb0e360b945444cc4bf1cc56ec Signed-off-by: Vinod G Reviewed-on: https://git-master.nvidia.com/r/1794856 Reviewed-by: svc-misra-checker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index f2b083d7..cdc00bbd 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -1561,19 +1561,6 @@ restore_fe_go_idle: if (err) goto clean_up; - nvgpu_kfree(g, gr->sm_error_states); - - /* we need to allocate this after g->ops.gr.init_fs_state() since - * we initialize gr->no_of_sm in this function - */ - gr->sm_error_states = nvgpu_kzalloc(g, - sizeof(struct nvgpu_gr_sm_error_state) - * gr->no_of_sm); - if (!gr->sm_error_states) { - err = -ENOMEM; - goto restore_fe_go_idle; - } - ctx_header_words = roundup(ctx_header_bytes, sizeof(u32)); ctx_header_words >>= 2; @@ -3072,7 +3059,6 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr) memset(&gr->compbit_store, 0, sizeof(struct compbit_store_desc)); - nvgpu_kfree(g, gr->sm_error_states); nvgpu_kfree(g, gr->gpc_tpc_count); nvgpu_kfree(g, gr->gpc_zcb_count); nvgpu_kfree(g, gr->gpc_ppc_count); @@ -4545,22 +4531,6 @@ restore_fe_go_idle: err = gr_gk20a_wait_idle(g, gk20a_get_gr_idle_timeout(g), GR_IDLE_CHECK_DEFAULT); - if (err) - goto out; - - nvgpu_kfree(g, gr->sm_error_states); - - /* we need to allocate this after g->ops.gr.init_fs_state() since - * we initialize gr->no_of_sm in this function - */ - gr->sm_error_states = nvgpu_kzalloc(g, - sizeof(struct nvgpu_gr_sm_error_state) * - gr->no_of_sm); - if (!gr->sm_error_states) { - err = -ENOMEM; - goto restore_fe_go_idle; - } - out: nvgpu_log_fn(g, "done"); return err; -- cgit v1.2.2