diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2019-10-01 18:20:25 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-10-14 11:32:07 -0400 |
commit | 12202fbdcfd73129b5bc582473fa6a8a93306de7 (patch) | |
tree | bf0c60232781e830b4855dd563def0786d224fce /drivers/gpu/nvgpu/os/linux | |
parent | 7b3d5d6bf07e9d7633995ca7c4c1ab4090a139e7 (diff) |
nvgpu: fix get_maxrate when no dvfs
In nvgpu_linux_get_maxrate, if tegra_dvfs_get_maxrate
returns 0 (a sign that there is no dvfs support), call
nvgpu_clk_arb_get_arbiter_clk_range to get the max
gpu frequency.
Bug 200543218
Change-Id: I4f9bc0acaef98cd9dfa22f709656f4bb7e9fd349
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2215161
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Satish Arora <satisha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/clk.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/clk.c b/drivers/gpu/nvgpu/os/linux/clk.c index 471f2aef..e9796eaf 100644 --- a/drivers/gpu/nvgpu/os/linux/clk.c +++ b/drivers/gpu/nvgpu/os/linux/clk.c | |||
@@ -122,10 +122,20 @@ static int nvgpu_linux_predict_mv_at_hz_cur_tfloor(struct clk_gk20a *clk, | |||
122 | static unsigned long nvgpu_linux_get_maxrate(struct gk20a *g, u32 api_domain) | 122 | static unsigned long nvgpu_linux_get_maxrate(struct gk20a *g, u32 api_domain) |
123 | { | 123 | { |
124 | int ret; | 124 | int ret; |
125 | u16 min_mhz, max_mhz; | ||
125 | 126 | ||
126 | switch (api_domain) { | 127 | switch (api_domain) { |
127 | case CTRL_CLK_DOMAIN_GPCCLK: | 128 | case CTRL_CLK_DOMAIN_GPCCLK: |
128 | ret = tegra_dvfs_get_maxrate(g->clk.tegra_clk_parent); | 129 | ret = tegra_dvfs_get_maxrate(g->clk.tegra_clk_parent); |
130 | /* If dvfs not supported */ | ||
131 | if (ret == 0) { | ||
132 | int err = nvgpu_clk_arb_get_arbiter_clk_range(g, | ||
133 | NVGPU_CLK_DOMAIN_GPCCLK, | ||
134 | &min_mhz, &max_mhz); | ||
135 | if (err == 0) { | ||
136 | ret = max_mhz * 1000000L; | ||
137 | } | ||
138 | } | ||
129 | break; | 139 | break; |
130 | default: | 140 | default: |
131 | nvgpu_err(g, "unknown clock: %u", api_domain); | 141 | nvgpu_err(g, "unknown clock: %u", api_domain); |