From 791ce6bd5480a8393c12be55e8afa459cb4dd1ff Mon Sep 17 00:00:00 2001 From: Seema Khowala Date: Tue, 23 Jan 2018 12:16:40 -0800 Subject: gpu: nvgpu: gv11b: enable more gr exceptions -pd, scc, ds, ssync, mme and sked exceptions are enabled. This will be useful for debugging -Handle enabled interrupts -Add gr ops to handle ssync hww. For legacy chips, ssync hww_esr register is gpcs_ppcs_ssync_hww_esr. Since ssync hww is not enabled on legacy chips, added ssync hww exception handling for volta only. Change-Id: I63ba2eb51fa82e74832df26ee4cf3546458e5669 Signed-off-by: Seema Khowala Reviewed-on: https://git-master.nvidia.com/r/1644751 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 38 +++++++++++++++++++++++++++++++++++++ drivers/gpu/nvgpu/gv11b/gr_gv11b.h | 1 + drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 1 + 3 files changed, 40 insertions(+) (limited to 'drivers/gpu/nvgpu/gv11b') diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index 6b43fcc8..3e207811 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -313,12 +313,32 @@ static int gr_gv11b_handle_lrf_exception(struct gk20a *g, u32 gpc, u32 tpc, void gr_gv11b_enable_hww_exceptions(struct gk20a *g) { /* enable exceptions */ + gk20a_writel(g, gr_fe_hww_esr_r(), gr_fe_hww_esr_en_enable_f() | gr_fe_hww_esr_reset_active_f()); gk20a_writel(g, gr_memfmt_hww_esr_r(), gr_memfmt_hww_esr_en_enable_f() | gr_memfmt_hww_esr_reset_active_f()); + gk20a_writel(g, gr_pd_hww_esr_r(), + gr_pd_hww_esr_en_enable_f() | + gr_pd_hww_esr_reset_active_f()); + gk20a_writel(g, gr_scc_hww_esr_r(), + gr_scc_hww_esr_en_enable_f() | + gr_scc_hww_esr_reset_active_f()); + gk20a_writel(g, gr_ds_hww_esr_r(), + gr_ds_hww_esr_en_enabled_f() | + gr_ds_hww_esr_reset_task_f()); + gk20a_writel(g, gr_ssync_hww_esr_r(), + gr_ssync_hww_esr_en_enable_f() | + gr_ssync_hww_esr_reset_active_f()); + gk20a_writel(g, gr_mme_hww_esr_r(), + gr_mme_hww_esr_en_enable_f() | + gr_mme_hww_esr_reset_active_f()); + + /* For now leave POR values */ + nvgpu_log(g, gpu_dbg_info, "gr_sked_hww_esr_en_r 0x%08x", + gk20a_readl(g, gr_sked_hww_esr_en_r())); } void gr_gv11b_fecs_host_int_enable(struct gk20a *g) @@ -351,8 +371,16 @@ void gr_gv11b_enable_exceptions(struct gk20a *g) reg_val = gr_exception_en_fe_enabled_f() | gr_exception_en_memfmt_enabled_f() | + gr_exception_en_pd_enabled_f() | + gr_exception_en_scc_enabled_f() | gr_exception_en_ds_enabled_f() | + gr_exception_en_ssync_enabled_f() | + gr_exception_en_mme_enabled_f() | + gr_exception_en_sked_enabled_f() | gr_exception_en_gpc_enabled_f(); + + nvgpu_log(g, gpu_dbg_info, "gr_exception_en 0x%08x", reg_val); + gk20a_writel(g, gr_exception_en_r(), reg_val); } @@ -4246,3 +4274,13 @@ u32 gr_gv11b_get_gpcs_swdx_dss_zbc_z_format_reg(struct gk20a *g) { return gr_gpcs_swdx_dss_zbc_z_01_to_04_format_r(); } + +int gr_gv11b_handle_ssync_hww(struct gk20a *g) +{ + u32 ssync = gk20a_readl(g, gr_ssync_hww_esr_r()); + + nvgpu_err(g, "ssync exception: esr 0x%08x", ssync); + gk20a_writel(g, gr_ssync_hww_esr_r(), + gr_ssync_hww_esr_reset_active_f()); + return -EFAULT; +} diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h index 157c567a..2f8d2e17 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h @@ -227,5 +227,6 @@ int gr_gv11b_set_ctxsw_preemption_mode(struct gk20a *g, void gr_gv11b_update_ctxsw_preemption_mode(struct gk20a *g, struct channel_gk20a *ch_ctx, struct nvgpu_mem *mem); +int gr_gv11b_handle_ssync_hww(struct gk20a *g); #endif diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index ec86d74c..91d80080 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -399,6 +399,7 @@ static const struct gpu_ops gv11b_ops = { .ecc_init_scrub_reg = gr_gv11b_ecc_init_scrub_reg, .dump_ctxsw_stats = gr_gp10b_dump_ctxsw_stats, .fecs_host_int_enable = gr_gv11b_fecs_host_int_enable, + .handle_ssync_hww = gr_gv11b_handle_ssync_hww, }, .fb = { .reset = gv11b_fb_reset, -- cgit v1.2.2