Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[linux-2.6-microblaze.git] / drivers / base / arch_topology.c
index e5d691c..4d0a003 100644 (file)
 #include <linux/sched.h>
 #include <linux/smp.h>
 
+__weak bool arch_freq_counters_available(struct cpumask *cpus)
+{
+       return false;
+}
 DEFINE_PER_CPU(unsigned long, freq_scale) = SCHED_CAPACITY_SCALE;
 
 void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
@@ -29,6 +33,14 @@ void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq,
        unsigned long scale;
        int i;
 
+       /*
+        * If the use of counters for FIE is enabled, just return as we don't
+        * want to update the scale factor with information from CPUFREQ.
+        * Instead the scale factor will be updated from arch_scale_freq_tick.
+        */
+       if (arch_freq_counters_available(cpus))
+               return;
+
        scale = (cur_freq << SCHED_CAPACITY_SHIFT) / max_freq;
 
        for_each_cpu(i, cpus)