diff options
author | Alex Frid <afrid@nvidia.com> | 2018-05-08 21:58:22 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-05-11 18:34:37 -0400 |
commit | 7a28547892bfa73d31c1423b33e98030840a4f6d (patch) | |
tree | 0c9f8c8dac79434d653a68ca933d2b3df750a779 /drivers/gpu/nvgpu/gm20b | |
parent | 0732f4b83ee8f055155f25c876c870ff7d20ae99 (diff) |
gpu: nvgpu: Fix Gpu sysfs access to Fmax@Vmin
Currently gpu sysfs retrieves Fmax@Vmin by direct call into Tegra DVFS
driver that introduces compile time dependencies on CONFIG_TEGRA_DVFS.
In addition incorrect clock is used for DVFS information access.
Re-factored sysfs node to use generic GPU clock operation for Fmax@Vmin
read. This would fix a bug in target clock selection, and allows to
remove dependency of sysfs on CONFIG_TEGRA_DVFS.
Updated nvgpu_linux_get_fmax_at_vmin_safe operation itself so it can be
called on platforms that does not support Tegra DVFS, although 0 will
still be returned as Fmax@Vmin on such platforms.
Bug 2045903
Change-Id: I32cce25320df026288c82458c913b0cde9ad4f72
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1710924
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index fb89752a..223166d1 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c | |||
@@ -1197,7 +1197,7 @@ int gm20b_init_clk_setup_sw(struct gk20a *g) | |||
1197 | goto fail; | 1197 | goto fail; |
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | safe_rate = g->ops.clk.get_fmax_at_vmin_safe(clk); | 1200 | safe_rate = g->ops.clk.get_fmax_at_vmin_safe(g); |
1201 | safe_rate = safe_rate * (100 - DVFS_SAFE_MARGIN) / 100; | 1201 | safe_rate = safe_rate * (100 - DVFS_SAFE_MARGIN) / 100; |
1202 | clk->dvfs_safe_max_freq = rate_gpu_to_gpc2clk(safe_rate); | 1202 | clk->dvfs_safe_max_freq = rate_gpu_to_gpc2clk(safe_rate); |
1203 | clk->gpc_pll.PL = (clk->dvfs_safe_max_freq == 0) ? 0 : | 1203 | clk->gpc_pll.PL = (clk->dvfs_safe_max_freq == 0) ? 0 : |