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>
This commit is contained in:
Peter Daifuku
2019-10-01 15:20:25 -07:00
committed by mobile promotions
parent 7b3d5d6bf0
commit 12202fbdcf

View File

@@ -122,10 +122,20 @@ static int nvgpu_linux_predict_mv_at_hz_cur_tfloor(struct clk_gk20a *clk,
static unsigned long nvgpu_linux_get_maxrate(struct gk20a *g, u32 api_domain)
{
int ret;
u16 min_mhz, max_mhz;
switch (api_domain) {
case CTRL_CLK_DOMAIN_GPCCLK:
ret = tegra_dvfs_get_maxrate(g->clk.tegra_clk_parent);
/* If dvfs not supported */
if (ret == 0) {
int err = nvgpu_clk_arb_get_arbiter_clk_range(g,
NVGPU_CLK_DOMAIN_GPCCLK,
&min_mhz, &max_mhz);
if (err == 0) {
ret = max_mhz * 1000000L;
}
}
break;
default:
nvgpu_err(g, "unknown clock: %u", api_domain);