summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/clk_arb_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_arb_gp106.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c b/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c
index 5f969e79..ca8015d6 100644
--- a/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_arb_gp106.c
@@ -55,20 +55,24 @@ int gp106_get_arbiter_clk_range(struct gk20a *g, u32 api_domain,
55 55
56 p5_info = pstate_get_clk_set_info(g, 56 p5_info = pstate_get_clk_set_info(g,
57 CTRL_PERF_PSTATE_P5, clkwhich); 57 CTRL_PERF_PSTATE_P5, clkwhich);
58 if (!p5_info) 58 if (!p5_info) {
59 return -EINVAL; 59 return -EINVAL;
60 }
60 61
61 p0_info = pstate_get_clk_set_info(g, 62 p0_info = pstate_get_clk_set_info(g,
62 CTRL_PERF_PSTATE_P0, clkwhich); 63 CTRL_PERF_PSTATE_P0, clkwhich);
63 if (!p0_info) 64 if (!p0_info) {
64 return -EINVAL; 65 return -EINVAL;
66 }
65 67
66 limit_min_mhz = p5_info->min_mhz; 68 limit_min_mhz = p5_info->min_mhz;
67 /* WAR for DVCO min */ 69 /* WAR for DVCO min */
68 if (api_domain == CTRL_CLK_DOMAIN_GPC2CLK) 70 if (api_domain == CTRL_CLK_DOMAIN_GPC2CLK) {
69 if ((pfllobjs->max_min_freq_mhz) && 71 if ((pfllobjs->max_min_freq_mhz) &&
70 (pfllobjs->max_min_freq_mhz >= limit_min_mhz)) 72 (pfllobjs->max_min_freq_mhz >= limit_min_mhz)) {
71 limit_min_mhz = pfllobjs->max_min_freq_mhz + 1; 73 limit_min_mhz = pfllobjs->max_min_freq_mhz + 1;
74 }
75 }
72 76
73 *min_mhz = limit_min_mhz; 77 *min_mhz = limit_min_mhz;
74 *max_mhz = p0_info->max_mhz; 78 *max_mhz = p0_info->max_mhz;
@@ -97,8 +101,9 @@ int gp106_get_arbiter_clk_default(struct gk20a *g, u32 api_domain,
97 101
98 p0_info = pstate_get_clk_set_info(g, 102 p0_info = pstate_get_clk_set_info(g,
99 CTRL_PERF_PSTATE_P0, clkwhich); 103 CTRL_PERF_PSTATE_P0, clkwhich);
100 if (!p0_info) 104 if (!p0_info) {
101 return -EINVAL; 105 return -EINVAL;
106 }
102 107
103 *default_mhz = p0_info->max_mhz; 108 *default_mhz = p0_info->max_mhz;
104 109