diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-01-12 11:08:10 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-20 12:45:19 -0500 |
commit | d0e3e668854d992f615406e461173a3cee114294 (patch) | |
tree | 69496c7684b53932216faa8bce63147e828c8207 /drivers/gpu/nvgpu/gk20a | |
parent | a470647ad71c3063fa76ec14ac67493045d0e122 (diff) |
gpu: nvgpu: compare rounded freq to last value
We right now compare requested value to the last
freq value. Last freq value is always a rounded
value, whereas requested value need not be a
rounded value
Hence it is incorrect to compare requested value
to last freq value
Fix this by comparing rounded value to last_freq
Change-Id: I7c6ea7c4e57105598c9af75efe70016b7fa8038b
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1287360
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index 36a47e24..edf92de6 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * gk20a clock scaling profile | 2 | * gk20a clock scaling profile |
3 | * | 3 | * |
4 | * Copyright (c) 2013-2016, NVIDIA Corporation. All rights reserved. | 4 | * Copyright (c) 2013-2017, NVIDIA Corporation. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -181,13 +181,13 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, | |||
181 | if (local_freq > max_freq) | 181 | if (local_freq > max_freq) |
182 | local_freq = max_freq; | 182 | local_freq = max_freq; |
183 | 183 | ||
184 | /* Check for duplicate request */ | ||
185 | if (local_freq == g->last_freq) | ||
186 | return 0; | ||
187 | |||
188 | /* set the final frequency */ | 184 | /* set the final frequency */ |
189 | rounded_rate = platform->clk_round_rate(dev, local_freq); | 185 | rounded_rate = platform->clk_round_rate(dev, local_freq); |
190 | 186 | ||
187 | /* Check for duplicate request */ | ||
188 | if (rounded_rate == g->last_freq) | ||
189 | return 0; | ||
190 | |||
191 | if (platform->clk_get_rate(dev) == rounded_rate) | 191 | if (platform->clk_get_rate(dev) == rounded_rate) |
192 | *freq = rounded_rate; | 192 | *freq = rounded_rate; |
193 | else { | 193 | else { |