diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-12-06 10:29:58 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-12-14 15:38:32 -0500 |
commit | 02b8cda953f7ff0cc9750b79b62712609da9d6ad (patch) | |
tree | 04a26e13f45075901811f1ddf9cc1dc6d637deaf | |
parent | 866dafa484414f8ee540696d5df7617fdb4b1fc9 (diff) |
gpu: nvgpu: store last_freq in gk20a struct
In gk20a_scale_target(), to check for duplicate
freq requests we compare current frequency with
devfreq->previous_freq
But for very first request after boot, we have
devfreq->previous_freq set to MIN freq
And in case we evaluate new frew as MIN freq
then we skip calling postscale() and scaling
of EMC clock
This results in keeping EMC at MAX value
To fix this, add new variable last_freq in
gk20a structure.
Use this variable to store frequency value
and to compare for duplicate requests
Bug 200255163
Bug 200257544
Change-Id: Icfc57234c63f68cce8ccf8221237105272dad853
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1263747
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 5 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 49c2a348..02d3ffe0 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -950,6 +950,7 @@ struct gk20a { | |||
950 | struct devfreq *devfreq; | 950 | struct devfreq *devfreq; |
951 | 951 | ||
952 | struct gk20a_scale_profile *scale_profile; | 952 | struct gk20a_scale_profile *scale_profile; |
953 | unsigned long last_freq; | ||
953 | 954 | ||
954 | struct gk20a_ctxsw_trace *ctxsw_trace; | 955 | struct gk20a_ctxsw_trace *ctxsw_trace; |
955 | struct gk20a_fecs_trace *fecs_trace; | 956 | struct gk20a_fecs_trace *fecs_trace; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index e3b21c5a..dbc2f06c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c | |||
@@ -182,7 +182,7 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, | |||
182 | local_freq = max_freq; | 182 | local_freq = max_freq; |
183 | 183 | ||
184 | /* Check for duplicate request */ | 184 | /* Check for duplicate request */ |
185 | if (local_freq == g->devfreq->previous_freq) | 185 | if (local_freq == g->last_freq) |
186 | return 0; | 186 | return 0; |
187 | 187 | ||
188 | /* set the final frequency */ | 188 | /* set the final frequency */ |
@@ -195,6 +195,8 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, | |||
195 | *freq = platform->clk_get_rate(dev); | 195 | *freq = platform->clk_get_rate(dev); |
196 | } | 196 | } |
197 | 197 | ||
198 | g->last_freq = *freq; | ||
199 | |||
198 | /* postscale will only scale emc (dram clock) if evaluating | 200 | /* postscale will only scale emc (dram clock) if evaluating |
199 | * gk20a_tegra_get_emc_rate() produces a new or different emc | 201 | * gk20a_tegra_get_emc_rate() produces a new or different emc |
200 | * target because the load or_and gpufreq has changed */ | 202 | * target because the load or_and gpufreq has changed */ |
@@ -259,6 +261,7 @@ void gk20a_scale_resume(struct device *dev) | |||
259 | if (!devfreq) | 261 | if (!devfreq) |
260 | return; | 262 | return; |
261 | 263 | ||
264 | g->last_freq = 0; | ||
262 | devfreq_resume_device(devfreq); | 265 | devfreq_resume_device(devfreq); |
263 | } | 266 | } |
264 | 267 | ||