From 69be500c0b6fab324a34fc0b0f6b80f21a128c7e Mon Sep 17 00:00:00 2001 From: seshendra Gadagottu Date: Mon, 9 Jul 2018 16:25:40 -0700 Subject: gpu: nvgpu: debugfs node to enable/disable ltc_illegal_compstat intr Added debugfs node under ltc directory with name: intr_illegal_compstat_enable Enabling/disabling of ltc_illegal_compstat intr is possible through debugfs node. Since ltc state is lost with rail gate, this setting is cached and will be populated during ltc initialization. Bug 2099406 Change-Id: I4bf62228dfd2bbb94f87f923f9f4f6e5ad0b07f0 Signed-off-by: seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/1774683 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gv11b/ltc_gv11b.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gv11b/ltc_gv11b.c') diff --git a/drivers/gpu/nvgpu/gv11b/ltc_gv11b.c b/drivers/gpu/nvgpu/gv11b/ltc_gv11b.c index 3cea4cd4..a040de23 100644 --- a/drivers/gpu/nvgpu/gv11b/ltc_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/ltc_gv11b.c @@ -70,10 +70,13 @@ void gv11b_ltc_init_fs_state(struct gk20a *g) /* Disable LTC interrupts */ reg = gk20a_readl(g, ltc_ltcs_ltss_intr_r()); reg &= ~ltc_ltcs_ltss_intr_en_evicted_cb_m(); - reg &= ~ltc_ltcs_ltss_intr_en_illegal_compstat_m(); reg &= ~ltc_ltcs_ltss_intr_en_illegal_compstat_access_m(); nvgpu_writel_check(g, ltc_ltcs_ltss_intr_r(), reg); + if (g->ops.ltc.intr_en_illegal_compstat) + g->ops.ltc.intr_en_illegal_compstat(g, + g->ltc_intr_en_illegal_compstat); + /* Enable ECC interrupts */ ltc_intr = gk20a_readl(g, ltc_ltcs_ltss_intr_r()); ltc_intr |= ltc_ltcs_ltss_intr_en_ecc_sec_error_enabled_f() | @@ -82,6 +85,24 @@ void gv11b_ltc_init_fs_state(struct gk20a *g) ltc_intr); } +void gv11b_ltc_intr_en_illegal_compstat(struct gk20a *g, bool enable) +{ + u32 val; + + /* disble/enble illegal_compstat interrupt */ + val = gk20a_readl(g, ltc_ltcs_ltss_intr_r()); + if (enable) + val = set_field(val, + ltc_ltcs_ltss_intr_en_illegal_compstat_m(), + ltc_ltcs_ltss_intr_en_illegal_compstat_enabled_f()); + else + val = set_field(val, + ltc_ltcs_ltss_intr_en_illegal_compstat_m(), + ltc_ltcs_ltss_intr_en_illegal_compstat_disabled_f()); + gk20a_writel(g, ltc_ltcs_ltss_intr_r(), val); +} + + void gv11b_ltc_isr(struct gk20a *g) { u32 mc_intr, ltc_intr3; -- cgit v1.2.2