gpu: nvgpu: update clk arbiter init

Initialize clk arbiter only when NVGPU_CLK_ARB_ENABLED flag is set.

JIRA NVGPU-9283

Change-Id: I69dcfab349af7293ce3b3edb588a30a101a36e94
Signed-off-by: Rajesh Devaraj <rdevaraj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2814780
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Rajesh Devaraj
2022-11-23 15:37:56 +00:00
committed by mobile promotions
parent b4b98aba02
commit 469ad373b4
3 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016-2021, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2016-2022, NVIDIA CORPORATION. All rights reserved.
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
@@ -441,7 +441,8 @@ int nvgpu_clk_arb_init_arbiter(struct gk20a *g)
{ {
int err = 0; int err = 0;
if (g->ops.clk_arb.check_clk_arb_support != NULL) { if ((nvgpu_is_enabled(g, NVGPU_CLK_ARB_ENABLED)) &&
(g->ops.clk_arb.check_clk_arb_support != NULL)) {
if (!g->ops.clk_arb.check_clk_arb_support(g)) { if (!g->ops.clk_arb.check_clk_arb_support(g)) {
return 0; return 0;
} }

View File

@@ -28,7 +28,8 @@
bool gp10b_check_clk_arb_support(struct gk20a *g) bool gp10b_check_clk_arb_support(struct gk20a *g)
{ {
if (g->ops.clk_arb.get_arbiter_clk_domains != NULL) { if ((nvgpu_is_enabled(g, NVGPU_CLK_ARB_ENABLED)) &&
g->ops.clk_arb.get_arbiter_clk_domains != NULL) {
return true; return true;
} }
else { else {

View File

@@ -1114,8 +1114,8 @@ int nvgpu_init_gpu_characteristics(struct gk20a *g)
nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG, true); nvgpu_set_enabled(g, NVGPU_SUPPORT_TSG, true);
#ifdef CONFIG_NVGPU_CLK_ARB #ifdef CONFIG_NVGPU_CLK_ARB
if ((g->ops.clk_arb.check_clk_arb_support != NULL) && if ((nvgpu_is_enabled(g, NVGPU_CLK_ARB_ENABLED)) &&
(nvgpu_is_enabled(g, NVGPU_CLK_ARB_ENABLED))){ (g->ops.clk_arb.check_clk_arb_support != NULL)) {
if (g->ops.clk_arb.check_clk_arb_support(g)) { if (g->ops.clk_arb.check_clk_arb_support(g)) {
nvgpu_set_enabled(g, NVGPU_SUPPORT_CLOCK_CONTROLS, nvgpu_set_enabled(g, NVGPU_SUPPORT_CLOCK_CONTROLS,
true); true);