devfreq: get dev status after checking if scaling is enabled

In nvhost_pod_estimate_freq(), we currently have below
sequence
- profile->get_dev_status()
- check if (!podgov->enable)
- check if (podgov->p_user)

But in case we have podgov disabled, we unnecessarily
call profile->get_dev_status()

Hence, do all such checks before calling get_dev_status()

Bug 200161377

Change-Id: I6128803c21bea6c5efefd517ea1c69e4f1b1597e
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/929508
Reviewed-on: http://git-master/r/933703
(cherry picked from linux-4.9 commit b8d1d439d206887c3cf4ff50119647b02efdae0e)
Reviewed-on: https://git-master.nvidia.com/r/1770135
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Timo Alho <talho@nvidia.com>
Tested-by: Timo Alho <talho@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Deepak Nibade
2016-01-06 18:20:57 +05:30
committed by Laxman Dewangan
parent efcf59c618
commit fbde18a19c

View File

@@ -729,10 +729,6 @@ static int nvhost_pod_estimate_freq(struct devfreq *df,
int stat;
ktime_t now;
stat = df->profile->get_dev_status(df->dev.parent, &dev_stat);
if (stat < 0)
return stat;
/* Ensure maximal clock when scaling is disabled */
if (!podgov->enable) {
*freq = df->max_freq;
@@ -744,6 +740,10 @@ static int nvhost_pod_estimate_freq(struct devfreq *df,
return 0;
}
stat = df->profile->get_dev_status(df->dev.parent, &dev_stat);
if (stat < 0)
return stat;
if (dev_stat.total_time == 0) {
*freq = dev_stat.current_frequency;
return 0;