From 7ff977063b2e980b5847e35d1e470bb9ae51b0e1 Mon Sep 17 00:00:00 2001 From: Divya Singhatwaria Date: Wed, 23 Feb 2022 18:09:59 +0530 Subject: [PATCH] gpu: nvgpu: add elpg protection for tpc_enabled_exceptions - DeviceGetTpcExceptionEnMask test calls ioctl NVGPU_GPU_IOCTL_GET_TPC_EXCEPTION_EN_STATUS which reads register gr_gpc0_tpc0_tpccs_tpc_exception_en_r(). This causes IDLE_SNAP and further disengages ELPG. - Add elpg protected call for the tpc_enabled_exceptions HAL. Bug 3522086 Change-Id: I137ac2c643c693b596b6ce3e879da9c786ee3a85 Signed-off-by: Divya Singhatwaria Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2674509 Reviewed-by: svc-mobile-coverity Reviewed-by: Antony Clince Alex Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 000940e99..88033547f 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -1004,7 +1004,8 @@ static int nvgpu_gpu_ioctl_has_any_exception( } nvgpu_mutex_acquire(&g->dbg_sessions_lock); - tpc_exception_en = g->ops.gr.intr.tpc_enabled_exceptions(g); + tpc_exception_en = nvgpu_pg_elpg_protected_call(g, + g->ops.gr.intr.tpc_enabled_exceptions(g)); nvgpu_mutex_release(&g->dbg_sessions_lock); args->tpc_exception_en_sm_mask = tpc_exception_en;