From 24a533c9dca646486ec549a930413bcb3c6e0f30 Mon Sep 17 00:00:00 2001 From: prsethi Date: Tue, 9 May 2023 05:19:46 +0000 Subject: [PATCH] nvgpu: print the caller name with quiesce Currently quiesce method does not print the caller name which makes it difficult to find the reason behind the issue. Change prints caller name and invocation line number. Bug 4098984 Change-Id: I34a0f557c411f997022668e187060c1c1247b15f Signed-off-by: prsethi Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2900585 Tested-by: mobile promotions Reviewed-by: mobile promotions --- drivers/gpu/nvgpu/common/init/nvgpu_init.c | 6 +++--- drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h | 4 +++- libs/dgpu/libnvgpu-drv-dgpu_safe.export | 2 +- libs/igpu/libnvgpu-drv-igpu_safe.export | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index b7231d146..fc12dbb67 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -195,7 +195,7 @@ static int nvgpu_sw_quiesce_init_support(struct gk20a *g) return 0; } -void nvgpu_sw_quiesce(struct gk20a *g) +void nvgpu_sw_quiesce_with_trace(struct gk20a *g, const char *fname, int line) { if (g->is_virtual || (g->enabled_flags == NULL) || nvgpu_is_enabled(g, NVGPU_DISABLE_SW_QUIESCE)) { @@ -209,11 +209,11 @@ void nvgpu_sw_quiesce(struct gk20a *g) } if (g->sw_quiesce_pending) { - nvgpu_err(g, "SW quiesce already pending"); + nvgpu_err(g, "%s:%d SW quiesce already pending", fname, line); return; } - nvgpu_err(g, "SW quiesce requested"); + nvgpu_err(g, "%s:%d SW quiesce requested", fname, line); /* * When this flag is set, interrupt handlers should diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h index c7afacde0..5507bb9ee 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvgpu_init.h @@ -164,7 +164,9 @@ int nvgpu_prepare_poweroff(struct gk20a *g); * still ring doorbell, but this will not trigger any work on * engines since fifo scheduling is disabled. */ -void nvgpu_sw_quiesce(struct gk20a *g); +void nvgpu_sw_quiesce_with_trace(struct gk20a *g, const char *fname, int line); +#define nvgpu_sw_quiesce(g) \ + nvgpu_sw_quiesce_with_trace(g, __func__, __LINE__) /** * @brief Cleanup SW Quiesce state diff --git a/libs/dgpu/libnvgpu-drv-dgpu_safe.export b/libs/dgpu/libnvgpu-drv-dgpu_safe.export index 766cd223b..f2738d415 100644 --- a/libs/dgpu/libnvgpu-drv-dgpu_safe.export +++ b/libs/dgpu/libnvgpu-drv-dgpu_safe.export @@ -721,7 +721,7 @@ nvgpu_spinlock_acquire nvgpu_spinlock_init nvgpu_spinlock_release nvgpu_strnadd_u32 -nvgpu_sw_quiesce +nvgpu_sw_quiesce_with_trace nvgpu_sw_quiesce_remove_support nvgpu_swprofile_initialize nvgpu_swprofile_snapshot diff --git a/libs/igpu/libnvgpu-drv-igpu_safe.export b/libs/igpu/libnvgpu-drv-igpu_safe.export index 2d12a30e9..0589023ac 100644 --- a/libs/igpu/libnvgpu-drv-igpu_safe.export +++ b/libs/igpu/libnvgpu-drv-igpu_safe.export @@ -751,7 +751,7 @@ nvgpu_spinlock_acquire nvgpu_spinlock_init nvgpu_spinlock_release nvgpu_strnadd_u32 -nvgpu_sw_quiesce +nvgpu_sw_quiesce_with_trace nvgpu_sw_quiesce_remove_support nvgpu_swprofile_initialize nvgpu_swprofile_snapshot