diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index 6bf21720c..f2688a2e2 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -1,7 +1,7 @@ /* * GK20A Graphics * - * Copyright (c) 2011-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2021, 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"), @@ -840,7 +840,8 @@ int nvgpu_init_gpu_characteristics(struct gk20a *g) nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG, true); #ifdef CONFIG_NVGPU_CLK_ARB - if (g->ops.clk_arb.check_clk_arb_support != NULL) { + if ((g->ops.clk_arb.check_clk_arb_support != NULL) && + (nvgpu_is_enabled(g, NVGPU_CLK_ARB_ENABLED))){ if (g->ops.clk_arb.check_clk_arb_support(g)) { nvgpu_set_enabled(g, NVGPU_SUPPORT_CLOCK_CONTROLS, true); diff --git a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c index 9a5796f5c..8601f702c 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gp10b.c @@ -1299,7 +1299,9 @@ int gp10b_init_hal(struct gk20a *g) g->max_sm_diversity_config_count = NVGPU_DEFAULT_SM_DIVERSITY_CONFIG_COUNT; - +#ifdef CONFIG_NVGPU_CLK_ARB + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, true); +#endif g->name = "gp10b"; return 0; diff --git a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c index bdec0bc9c..01476bb84 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/init/hal_gv11b.c @@ -1605,6 +1605,9 @@ int gv11b_init_hal(struct gk20a *g) #else g->max_sm_diversity_config_count = NVGPU_DEFAULT_SM_DIVERSITY_CONFIG_COUNT; +#endif +#ifdef CONFIG_NVGPU_CLK_ARB + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, true); #endif g->name = "gv11b"; diff --git a/drivers/gpu/nvgpu/hal/init/hal_tu104.c b/drivers/gpu/nvgpu/hal/init/hal_tu104.c index 40ba22fb1..576407200 100644 --- a/drivers/gpu/nvgpu/hal/init/hal_tu104.c +++ b/drivers/gpu/nvgpu/hal/init/hal_tu104.c @@ -1838,13 +1838,16 @@ int tu104_init_hal(struct gk20a *g) /* Disable clock support */ #ifdef CONFIG_NVGPU_CLK_ARB gops->clk_arb.get_arbiter_clk_domains = NULL; + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, false); #endif } else #endif { nvgpu_set_enabled(g, NVGPU_GR_USE_DMA_FOR_FW_BOOTSTRAP, true); } - +#ifdef CONFIG_NVGPU_CLK_ARB + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, false); +#endif g->name = "tu10x"; return 0; diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c index bba5261e2..9a9916ca9 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gp10b.c @@ -960,6 +960,7 @@ int vgpu_gp10b_init_hal(struct gk20a *g) if (!priv->constants.can_set_clkrate) { gops->clk_arb.get_arbiter_clk_domains = NULL; + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, false); } g->max_sm_diversity_config_count = @@ -972,6 +973,7 @@ int vgpu_gp10b_init_hal(struct gk20a *g) #ifdef CONFIG_NVGPU_RECOVERY nvgpu_set_enabled(g, NVGPU_SUPPORT_FAULT_RECOVERY, true); #endif + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, true); g->name = "gp10b"; diff --git a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c index fe53baf31..8308bf433 100644 --- a/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c +++ b/drivers/gpu/nvgpu/hal/vgpu/init/vgpu_hal_gv11b.c @@ -1074,6 +1074,7 @@ int vgpu_gv11b_init_hal(struct gk20a *g) if (!priv->constants.can_set_clkrate) { gops->clk_arb.get_arbiter_clk_domains = NULL; + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, false); } #ifdef CONFIG_NVGPU_SM_DIVERSITY @@ -1118,6 +1119,7 @@ int vgpu_gv11b_init_hal(struct gk20a *g) #ifdef CONFIG_NVGPU_RECOVERY nvgpu_set_enabled(g, NVGPU_SUPPORT_FAULT_RECOVERY, true); #endif + nvgpu_set_enabled(g, NVGPU_CLK_ARB_ENABLED, true); g->name = "gv11b"; diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 066413268..5f5b4178b 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -209,6 +209,7 @@ struct gk20a; DEFINE_FLAG(NVGPU_ELPG_MS_ENABLED, "ELPG_MS support"), \ DEFINE_FLAG(NVGPU_L2_MAX_WAYS_EVICT_LAST_ENABLED, \ "Set L2 Max Ways Evict Last support"), \ + DEFINE_FLAG(NVGPU_CLK_ARB_ENABLED, "CLK_ARB support"), \ DEFINE_FLAG(NVGPU_MAX_ENABLED_BITS, "Marks max number of flags"), /**