From 505251d6969d8305629d122d0afbef5e520ddd5b Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 3 Mar 2020 15:58:42 +0530 Subject: gpu: nvgpu: make debugger register access ELPG protected Some of the APIs that access debugger register are not protected from ELPG. This might trigger PRI access timeouts for corresponding registers if GR engine is power gated. Add gr_gk20a_elpg_protected_call() to protect against ELPG. Bug 2820066 Change-Id: I467ea28aaea1c0e36c2d6aabce6a2daea6ee9911 Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2306383 (cherry picked from commit 0c0eb25ee798db3a8dcd8cab7db06312a220240e) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2313210 Reviewed-by: automaticguardword Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/os') diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 8ad304bd..6fa15421 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -660,7 +660,8 @@ static int nvgpu_gpu_ioctl_trigger_suspend(struct gk20a *g) return err; nvgpu_mutex_acquire(&g->dbg_sessions_lock); - err = g->ops.gr.trigger_suspend(g); + err = gr_gk20a_elpg_protected_call(g, + g->ops.gr.trigger_suspend(g)); nvgpu_mutex_release(&g->dbg_sessions_lock); gk20a_idle(g); @@ -695,7 +696,8 @@ static int nvgpu_gpu_ioctl_wait_for_pause(struct gk20a *g, goto out_free; nvgpu_mutex_acquire(&g->dbg_sessions_lock); - g->ops.gr.wait_for_pause(g, w_state); + (void)gr_gk20a_elpg_protected_call(g, + g->ops.gr.wait_for_pause(g, w_state)); for (sm_id = 0; sm_id < g->gr.no_of_sm; sm_id++) { ioctl_w_state[sm_id].valid_warps[0] = @@ -738,7 +740,8 @@ static int nvgpu_gpu_ioctl_resume_from_pause(struct gk20a *g) return err; nvgpu_mutex_acquire(&g->dbg_sessions_lock); - err = g->ops.gr.resume_from_pause(g); + err = gr_gk20a_elpg_protected_call(g, + g->ops.gr.resume_from_pause(g)); nvgpu_mutex_release(&g->dbg_sessions_lock); gk20a_idle(g); @@ -754,7 +757,8 @@ static int nvgpu_gpu_ioctl_clear_sm_errors(struct gk20a *g) if (err) return err; - err = g->ops.gr.clear_sm_errors(g); + err = gr_gk20a_elpg_protected_call(g, + g->ops.gr.clear_sm_errors(g)); gk20a_idle(g); -- cgit v1.2.2