From 493df6cb6eeebfa6dddcf6c787dd5e811e210e59 Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Wed, 14 Jul 2021 10:34:24 +0530 Subject: [PATCH] gpu: nvgpu: resolve CE debugfs NULL access issues CE_APP is created only when CONFIG_NVGPU_DGPU is enabled. Consequently, create CE debugfs entries only when CONFIG_NVGPU_DGPU is enabled to avoid NULL access failures. Bug 200747304 Change-Id: Idf0829927b6578da4007f3c5c5ca5ae8f0ed11db Signed-off-by: Debarshi Dutta Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2558712 Reviewed-by: svcacv Reviewed-by: svc_kernel_abi Reviewed-by: Sachin Nikam Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/debug.c b/drivers/gpu/nvgpu/os/linux/debug.c index aa258e382..d39426960 100644 --- a/drivers/gpu/nvgpu/os/linux/debug.c +++ b/drivers/gpu/nvgpu/os/linux/debug.c @@ -511,8 +511,6 @@ void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) #ifdef CONFIG_NVGPU_SUPPORT_CDE gk20a_cde_debugfs_init(g); #endif - if (!g->is_virtual) - nvgpu_ce_debugfs_init(g); nvgpu_alloc_debugfs_init(g); nvgpu_hal_debugfs_init(g); gk20a_fifo_debugfs_init(g); @@ -522,6 +520,8 @@ void gk20a_debug_init(struct gk20a *g, const char *debugfs_symlink) #endif nvgpu_ltc_debugfs_init(g); #ifdef CONFIG_NVGPU_DGPU + if (!g->is_virtual) + nvgpu_ce_debugfs_init(g); if (g->pci_vendor_id) { nvgpu_xve_debugfs_init(g); nvgpu_bios_debugfs_init(g);