diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 49c2a3482..02d3ffe07 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -950,6 +950,7 @@ struct gk20a { struct devfreq *devfreq; struct gk20a_scale_profile *scale_profile; + unsigned long last_freq; struct gk20a_ctxsw_trace *ctxsw_trace; 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 e3b21c5a5..dbc2f06c7 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, local_freq = max_freq; /* Check for duplicate request */ - if (local_freq == g->devfreq->previous_freq) + if (local_freq == g->last_freq) return 0; /* set the final frequency */ @@ -195,6 +195,8 @@ static int gk20a_scale_target(struct device *dev, unsigned long *freq, *freq = platform->clk_get_rate(dev); } + g->last_freq = *freq; + /* postscale will only scale emc (dram clock) if evaluating * gk20a_tegra_get_emc_rate() produces a new or different emc * target because the load or_and gpufreq has changed */ @@ -259,6 +261,7 @@ void gk20a_scale_resume(struct device *dev) if (!devfreq) return; + g->last_freq = 0; devfreq_resume_device(devfreq); }