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>
This commit is contained in:
Deepak Nibade
2017-01-12 21:38:10 +05:30
committed by mobile promotions
parent a470647ad7
commit d0e3e66885

View File

@@ -1,7 +1,7 @@
/* /*
* gk20a clock scaling profile * gk20a clock scaling profile
* *
* Copyright (c) 2013-2016, NVIDIA Corporation. All rights reserved. * Copyright (c) 2013-2017, NVIDIA Corporation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License, * 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,
if (local_freq > max_freq) if (local_freq > max_freq)
local_freq = max_freq; local_freq = max_freq;
/* Check for duplicate request */
if (local_freq == g->last_freq)
return 0;
/* set the final frequency */ /* set the final frequency */
rounded_rate = platform->clk_round_rate(dev, local_freq); rounded_rate = platform->clk_round_rate(dev, local_freq);
/* Check for duplicate request */
if (rounded_rate == g->last_freq)
return 0;
if (platform->clk_get_rate(dev) == rounded_rate) if (platform->clk_get_rate(dev) == rounded_rate)
*freq = rounded_rate; *freq = rounded_rate;
else { else {