From 4c2e2bb0b957fdd36195e7f4d3f71cf4581848c5 Mon Sep 17 00:00:00 2001 From: Divya Date: Tue, 7 Dec 2021 17:43:32 +0000 Subject: [PATCH] gpu: nvgpu: Reduce allow/disallow in stall_isr With the existing implemenatation ELPG was disabled and enabled once for handling stall isr and then again ELPG is disabled and aenabled for writing to gr retrigger register. This increased number of ELPG cycles and degraded perf of various graphics test with ELPG enabled. This change now disables ELPG, then handles stall_isr and write to gr retrigger register and then enables ELPG. Thus, number of ELPG cycles are reduced. Bug 3451615 Change-Id: Iadac0c7b01eb711878280cd1503ba0f26000937c Signed-off-by: Divya Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2638175 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: svc-mobile-cert Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/hal/mc/mc_intr_ga10b_fusa.c | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/hal/mc/mc_intr_ga10b_fusa.c b/drivers/gpu/nvgpu/hal/mc/mc_intr_ga10b_fusa.c index c2c57546d..8dffb77bb 100644 --- a/drivers/gpu/nvgpu/hal/mc/mc_intr_ga10b_fusa.c +++ b/drivers/gpu/nvgpu/hal/mc/mc_intr_ga10b_fusa.c @@ -711,20 +711,36 @@ static void ga10b_intr_isr_stall_host2soc_2(struct gk20a *g) static int ga10b_intr_gr_stall_isr(struct gk20a *g) { - int err; + int err = 0; - err = nvgpu_pg_elpg_protected_call(g, g->ops.gr.intr.stall_isr(g)); +#ifdef CONFIG_NVGPU_POWER_PG + /* Disable ELPG before handling stall isr */ + err = nvgpu_pg_elpg_disable(g); + if (err != 0) { + nvgpu_err(g, "ELPG disable failed." + "Going ahead with stall_isr handling"); + } +#endif + /* handle stall isr */ + err = g->ops.gr.intr.stall_isr(g); if (err != 0) { nvgpu_err(g, "GR intr stall_isr failed"); return err; } - err = nvgpu_pg_elpg_protected_call(g, g->ops.gr.intr.retrigger(g)); + err = g->ops.gr.intr.retrigger(g); if (err != 0) { nvgpu_err(g, "GR intr retrigger failed"); return err; } +#ifdef CONFIG_NVGPU_POWER_PG + /* enable elpg again */ + err = nvgpu_pg_elpg_enable(g); + if (err != 0) { + nvgpu_err(g, "ELPG enable failed."); + } +#endif return err; }