gpu: nvgpu: gp10b: fix freq rounding

In gp10b_round_clk_rate(), we right now return next
higher freq value than requested if requested value
matches a value in the table

Fix this by adding a right comparison

Bug 200194487

Change-Id: Ia99abfe4b247701d5ee1cda26b3ffcc18efba353
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1284302
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
This commit is contained in:
Deepak Nibade
2017-01-12 21:16:30 +05:30
committed by mobile promotions
parent 76dc6659ff
commit 157ff622f3

View File

@@ -348,7 +348,7 @@ static long gp10b_round_clk_rate(struct device *dev, unsigned long rate)
int i;
for (i = 0; i < max_states; ++i)
if (freq_table[i] > rate)
if (freq_table[i] >= rate)
return freq_table[i];
return freq_table[max_states - 1];