From 8f30251c67811834f9d93b50ce3e97fe3aa18051 Mon Sep 17 00:00:00 2001 From: Vaibhav Kachore Date: Thu, 27 Sep 2018 14:19:14 +0530 Subject: gpu: nvgpu: fix update hwpm ctxsw mode - Depending on main context or subcontext, ctxheader and gr_mem should be updated with pm mode and buffer addresss accordingly Bug 2404093 Change-Id: Iba16c762c09b2a420570d4f528205e258ff27e8f Signed-off-by: Vaibhav Kachore Reviewed-on: https://git-master.nvidia.com/r/1849396 Reviewed-by: svc-misra-checker Reviewed-by: Deepak Nibade GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 6c885b59..0250e97e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -1853,11 +1853,11 @@ int gr_gk20a_update_hwpm_ctxsw_mode(struct gk20a *g, data |= pm_ctx->pm_mode; - nvgpu_mem_wr(g, gr_mem, ctxsw_prog_main_image_pm_o(), data); - if (ctxheader->gpu_va) { + nvgpu_mem_wr(g, ctxheader, ctxsw_prog_main_image_pm_o(), data); g->ops.gr.write_pm_ptr(g, ctxheader, virt_addr); } else { + nvgpu_mem_wr(g, gr_mem, ctxsw_prog_main_image_pm_o(), data); g->ops.gr.write_pm_ptr(g, gr_mem, virt_addr); } -- cgit v1.2.2