From 6e2f5a85d3dbdba85e1b58586d9442bcb6efabe2 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Mon, 23 Sep 2019 13:30:22 +0530 Subject: [PATCH] gpu: nvgpu: rectify incorrect setting of pbdma_acquire_timeout The driver was incorrectly setting pbdma_acquire_timeout during default init when kernelmode submits were disabled. This is corrected to make the behavior similar to the previous mode. Also, added logging for the pbdma_acquire_timeout value being set in NV_RAMFC_ Jira NVGPU-3172 Change-Id: Ic39638386bd999871cd8eafec70a3770bc648f93 Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/2203580 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/fifo/channel.c | 4 ---- drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index e8c89db8a..04f6583a4 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c @@ -2085,10 +2085,6 @@ static int channel_setup_ramfc(struct nvgpu_channel *c, if (c->wdt.enabled && nvgpu_is_timeouts_enabled(c->g)) { pbdma_acquire_timeout = c->wdt.limit_ms; } -#else - if (nvgpu_is_timeouts_enabled(c->g)) { - pbdma_acquire_timeout = g->ch_wdt_init_limit_ms; - } #endif err = g->ops.ramfc.setup(c, gpfifo_gpu_va, gpfifo_size, diff --git a/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c b/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c index 4ffe7af76..e64d1c498 100644 --- a/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c +++ b/drivers/gpu/nvgpu/hal/fifo/ramfc_gv11b_fusa.c @@ -50,6 +50,9 @@ int gv11b_ramfc_setup(struct nvgpu_channel *ch, u64 gpfifo_base, } #endif + nvgpu_log_info(g, "%llu %u", pbdma_acquire_timeout, + g->ops.pbdma.acquire_val(pbdma_acquire_timeout)); + g->ops.ramin.init_subctx_pdb(g, mem, ch->vm->pdb.mem, replayable); nvgpu_mem_wr32(g, mem, ram_fc_gp_base_w(),