]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
devfreq: compare previous_freq only if podgov disabled
authorDeepak Nibade <dnibade@nvidia.com>
Wed, 16 Mar 2016 10:22:20 +0000 (15:52 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Sat, 19 Mar 2016 06:37:40 +0000 (23:37 -0700)
In update_devfreq(), we currently get target frequency,
compare it with previous_freq, and set it only if
new freq is different one

But get_target_freq() (nvhost_pod_estimate_freq())
already takes care of such cases in normal conditions
Hence, remove the check with previous_freq in
update_devfreq()

For case when we disable podgov governor, we might still end
up setting max freq all the time
Hence, add a check on previous_freq, and if previous_freq
is already max, do not set it

Bug 200175874
Bug 200161377

Change-Id: I287d37c07ee6214ed48612482211ce0f45088ca4
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1111437
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/devfreq/devfreq.c
drivers/devfreq/governor_pod_scaling.c

index e485ddafe861de031eef4268a26b365834cc5746..0773c89b1a3c7577907243d17ba698a82698874d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2011 Samsung Electronics
  *     MyungJoo Ham <myungjoo.ham@samsung.com>
- * Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -189,9 +189,6 @@ int update_devfreq(struct devfreq *devfreq)
        if (err)
                return err;
 
-       if (devfreq->previous_freq == freq)
-               return 0;
-
        /*
         * Adjust the freuqency with user freq and QoS.
         *
index 31ac882ca7fa1d647d71fa30620800382f062bc6..1084689e1a788a3b2f70ac112e72c5f8209f86f4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Tegra Graphics Host 3D clock scaling
  *
- * Copyright (c) 2012-2015, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2012-2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -732,7 +732,10 @@ static int nvhost_pod_estimate_freq(struct devfreq *df,
        /* Ensure maximal clock when scaling is disabled */
        if (!podgov->enable) {
                *freq = df->max_freq;
-               return 0;
+               if (*freq == df->previous_freq)
+                       return GET_TARGET_FREQ_DONTSCALE;
+               else
+                       return 0;
        }
 
        if (podgov->p_user) {