From 3207a29fd72dc598f2527756c446ecab9bd62657 Mon Sep 17 00:00:00 2001 From: srajum Date: Sat, 13 May 2023 23:40:04 +0530 Subject: [PATCH] gpu: nvgpu: enable run time log mask for safety debug and standard debug builds - Enable /dev/nvgpu/igpu0/log_mask node on safey debug and standard debug builds which will help to enable log mask in run time. - Enabled "CONFIG_NVGPU_SYSFS" flag for release and safety debug builds which will build sysfs files to enable /dev/nvgpu/igpu0/log_mask node for these builds - Created "standard_debug" profile which is used to enable /dev/nvgpu/igpu0/log_mask node only for standard debug builds Bug 3958585 Change-Id: Id35cd617550974ee805c83e026e2bb5f3be768c6 Signed-off-by: srajum Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2903881 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Prateek Sethi Reviewed-by: Vaibhav Kachore GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/Makefile.shared.configs | 15 ++++++++++----- drivers/gpu/nvgpu/os/posix/stubs.c | 4 +++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index 452bc152b..029503685 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -48,6 +48,11 @@ endif NVGPU_COMMON_CFLAGS := +# Enable debug flag for both safety debug and standard debug builds. +ifeq ($(NV_BUILD_CONFIGURATION_IS_DEBUG),1) +NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_BUILD_CONFIGURATION_IS_DEBUG +endif + # # Flags always enabled regardless of build profile. # @@ -202,6 +207,11 @@ endif CONFIG_NVGPU_FALCON_DEBUG := 1 NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_FALCON_DEBUG +ifneq ($(NVGPU_HVRTOS),1) +CONFIG_NVGPU_SYSFS := 1 +NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_SYSFS +endif + # # Flags enabled only for regular build profile. # @@ -216,11 +226,6 @@ endif endif endif -ifneq ($(NVGPU_HVRTOS),1) -CONFIG_NVGPU_SYSFS := 1 -NVGPU_COMMON_CFLAGS += -DCONFIG_NVGPU_SYSFS -endif - # Enable FSI Error injection support only on regular build when the # build configuartion is VLTest. The safety build will use # Mon process, so error injection on safety build is part of Mon diff --git a/drivers/gpu/nvgpu/os/posix/stubs.c b/drivers/gpu/nvgpu/os/posix/stubs.c index 5156f76fe..206269492 100644 --- a/drivers/gpu/nvgpu/os/posix/stubs.c +++ b/drivers/gpu/nvgpu/os/posix/stubs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -41,11 +41,13 @@ void nvgpu_dbg_session_post_event(struct dbg_session_gk20a *dbg_s) #ifdef CONFIG_NVGPU_SYSFS int nvgpu_ecc_sysfs_init(struct gk20a *g) { + (void)g; return 0; } void nvgpu_ecc_sysfs_remove(struct gk20a *g) { + (void)g; } #endif