]> git.baikalelectronics.ru Git - kernel.git/commitdiff
cpufreq: Add strict_target to struct cpufreq_policy
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 10 Nov 2020 17:26:37 +0000 (18:26 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 10 Nov 2020 17:31:17 +0000 (18:31 +0100)
Add a new field to be set when the CPUFREQ_GOV_STRICT_TARGET flag is
set for the current governor to struct cpufreq_policy, so that the
drivers needing to check CPUFREQ_GOV_STRICT_TARGET do not have to
access the governor object during every frequency transition.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h

index 0252903f1b4330ac3145a331f382cefd31defcdc..1e7e3f2ff09f0d6236491bb2f380a2b3ad2d6273 100644 (file)
@@ -2280,6 +2280,8 @@ static int cpufreq_init_governor(struct cpufreq_policy *policy)
                }
        }
 
+       policy->strict_target = !!(policy->governor->flags & CPUFREQ_GOV_STRICT_TARGET);
+
        return 0;
 }
 
index 6eb9a3b8ec7b0a715006b56e23c6cc07cc335cd3..acbad3b363226efa0bd6dd45514cc1490edb2813 100644 (file)
@@ -109,6 +109,12 @@ struct cpufreq_policy {
        bool                    fast_switch_possible;
        bool                    fast_switch_enabled;
 
+       /*
+        * Set if the CPUFREQ_GOV_STRICT_TARGET flag is set for the current
+        * governor.
+        */
+       bool                    strict_target;
+
        /*
         * Preferred average time interval between consecutive invocations of
         * the driver to set the frequency for this policy.  To be set by the