From 4940f4c1b44077849d1c3bbc63edcbc8c6d07480 Mon Sep 17 00:00:00 2001 From: Tejal Kudav Date: Wed, 29 Aug 2018 11:50:02 +0530 Subject: gpu: nvgpu: Set nvdec mailbox reg 0 to nonzero val The scrubber binary after completion updates its return code in mailbox register 0. The memory unlock code reads this registers to determine the success of memory scrubbing. This register is initialized to 0 during nvdec falcon reset. If the scrubber binary halts due to an error condition, the return code is not updated and it stays at 0. Initialize the status register explicitly to non-zero value helps avoid just false positives. Add falcon register dump and PC trace to help debug the memory unlock failures. Change-Id: I3086dda2a9719c2d0b8a7ae898f1a03bedfa21b0 Signed-off-by: Tejal Kudav Reviewed-on: https://git-master.nvidia.com/r/1808899 Reviewed-by: Deepak Goyal Reviewed-by: svc-misra-checker Reviewed-by: Deepak Nibade Reviewed-by: Mahantesh Kumbar GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fb/fb_gv100.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/common/fb/fb_gv100.c') diff --git a/drivers/gpu/nvgpu/common/fb/fb_gv100.c b/drivers/gpu/nvgpu/common/fb/fb_gv100.c index d092ff4a..ce51a2c6 100644 --- a/drivers/gpu/nvgpu/common/fb/fb_gv100.c +++ b/drivers/gpu/nvgpu/common/fb/fb_gv100.c @@ -192,6 +192,11 @@ int gv100_fb_memory_unlock(struct gk20a *g) mem_unlock_ucode_header[OS_DATA_OFFSET] >> 2], mem_unlock_ucode_header[OS_DATA_SIZE], 0); + /* Write non-zero value to mailbox register which is updated by + * mem_unlock bin to denote its return status. + */ + nvgpu_flcn_mailbox_write(&g->nvdec_flcn, 0, 0xdeadbeef); + /* set BOOTVEC to start of non-secure code */ nvgpu_flcn_bootstrap(&g->nvdec_flcn, 0); @@ -202,6 +207,7 @@ int gv100_fb_memory_unlock(struct gk20a *g) val = nvgpu_flcn_mailbox_read(&g->nvdec_flcn, 0); if (val) { nvgpu_err(g, "memory unlock failed, err %x", val); + nvgpu_flcn_dump_stats(&g->nvdec_flcn); err = -1; goto exit; } -- cgit v1.2.2