summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
diff options
context:
space:
mode:
authorVinod G <vinodg@nvidia.com>2018-08-08 02:09:30 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-25 05:10:43 -0400
commitbfe65407bde2b5d0776724301e215c6553c989f3 (patch)
treef68a01361052afe1c30a0c6dcd5d359b762e647a /drivers/gpu/nvgpu/gk20a/gr_gk20a.c
parent3bd47da0954d3486d9ccd3c396f84445918f82b4 (diff)
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 <vinodg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1794856 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c30
1 files changed, 0 insertions, 30 deletions
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:
1561 if (err) 1561 if (err)
1562 goto clean_up; 1562 goto clean_up;
1563 1563
1564 nvgpu_kfree(g, gr->sm_error_states);
1565
1566 /* we need to allocate this after g->ops.gr.init_fs_state() since
1567 * we initialize gr->no_of_sm in this function
1568 */
1569 gr->sm_error_states = nvgpu_kzalloc(g,
1570 sizeof(struct nvgpu_gr_sm_error_state)
1571 * gr->no_of_sm);
1572 if (!gr->sm_error_states) {
1573 err = -ENOMEM;
1574 goto restore_fe_go_idle;
1575 }
1576
1577 ctx_header_words = roundup(ctx_header_bytes, sizeof(u32)); 1564 ctx_header_words = roundup(ctx_header_bytes, sizeof(u32));
1578 ctx_header_words >>= 2; 1565 ctx_header_words >>= 2;
1579 1566
@@ -3072,7 +3059,6 @@ static void gk20a_remove_gr_support(struct gr_gk20a *gr)
3072 3059
3073 memset(&gr->compbit_store, 0, sizeof(struct compbit_store_desc)); 3060 memset(&gr->compbit_store, 0, sizeof(struct compbit_store_desc));
3074 3061
3075 nvgpu_kfree(g, gr->sm_error_states);
3076 nvgpu_kfree(g, gr->gpc_tpc_count); 3062 nvgpu_kfree(g, gr->gpc_tpc_count);
3077 nvgpu_kfree(g, gr->gpc_zcb_count); 3063 nvgpu_kfree(g, gr->gpc_zcb_count);
3078 nvgpu_kfree(g, gr->gpc_ppc_count); 3064 nvgpu_kfree(g, gr->gpc_ppc_count);
@@ -4545,22 +4531,6 @@ restore_fe_go_idle:
4545 4531
4546 err = gr_gk20a_wait_idle(g, gk20a_get_gr_idle_timeout(g), 4532 err = gr_gk20a_wait_idle(g, gk20a_get_gr_idle_timeout(g),
4547 GR_IDLE_CHECK_DEFAULT); 4533 GR_IDLE_CHECK_DEFAULT);
4548 if (err)
4549 goto out;
4550
4551 nvgpu_kfree(g, gr->sm_error_states);
4552
4553 /* we need to allocate this after g->ops.gr.init_fs_state() since
4554 * we initialize gr->no_of_sm in this function
4555 */
4556 gr->sm_error_states = nvgpu_kzalloc(g,
4557 sizeof(struct nvgpu_gr_sm_error_state) *
4558 gr->no_of_sm);
4559 if (!gr->sm_error_states) {
4560 err = -ENOMEM;
4561 goto restore_fe_go_idle;
4562 }
4563
4564out: 4534out:
4565 nvgpu_log_fn(g, "done"); 4535 nvgpu_log_fn(g, "done");
4566 return err; 4536 return err;