From 76eb949edb9de625bbf15f81782d8c52b3e2d301 Mon Sep 17 00:00:00 2001 From: Thomas Fleury Date: Mon, 14 Oct 2019 16:44:46 -0400 Subject: [PATCH] gpu: nvgpu: add flag to disable SW quiesce Add NVGPU_DISABLE_SW_QUIESCE flag which can be set in unit tests to avoid entering SW quiesce. Jira NVGPU-4089 Change-Id: Ie44b28bf69ff86908a66bb1be8aab3d365945178 Signed-off-by: Thomas Fleury Reviewed-on: https://git-master.nvidia.com/r/2217828 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Deepak Nibade GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/init/nvgpu_init.c | 3 ++- drivers/gpu/nvgpu/include/nvgpu/enabled.h | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index db8c28b55..4832382ec 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -156,7 +156,8 @@ static void nvgpu_sw_quiesce_remove_support(struct gk20a *g) void nvgpu_sw_quiesce(struct gk20a *g) { #ifndef CONFIG_NVGPU_RECOVERY - if (g->is_virtual) { + if (g->is_virtual || g->enabled_flags == NULL || + nvgpu_is_enabled(g, NVGPU_DISABLE_SW_QUIESCE)) { goto fail; } diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 87f5a5031..d1b9acd7b 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -210,10 +210,13 @@ struct gk20a; /* Fault recovery support */ #define NVGPU_SUPPORT_FAULT_RECOVERY 80U +/* SW Quiesce */ +#define NVGPU_DISABLE_SW_QUIESCE 81U + /* * Must be greater than the largest bit offset in the above list. */ -#define NVGPU_MAX_ENABLED_BITS 81U +#define NVGPU_MAX_ENABLED_BITS 82U /** * nvgpu_is_enabled - Check if the passed flag is enabled.