summaryrefslogtreecommitdiff
path: root/drivers/base
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-10-05 13:12:02 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-10-05 13:12:02 +0200
commitfccd2f0e629b357437bebc015810f7f1957a4643 (patch)
tree4d0cc002fb0e0d487e66d205f115737f37933b98 /drivers/base
parentfc7d17551f776fda243493ce59894c1eec2a339f (diff)
parent15e5d5b45b2b7072214af519357a1c0af078c50b (diff)
Merge back cpufreq material for 5.10.
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/arch_topology.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
index 75f72d684294..89cae168b076 100644
--- a/drivers/base/arch_topology.c
+++ b/drivers/base/arch_topology.c
@@ -21,18 +21,27 @@
#include <linux/sched.h>
#include <linux/smp.h>
-__weak bool arch_freq_counters_available(struct cpumask *cpus)
+bool topology_scale_freq_invariant(void)
+{
+ return cpufreq_supports_freq_invariance() ||
+ arch_freq_counters_available(cpu_online_mask);
+}
+
+__weak bool arch_freq_counters_available(const 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,
+void arch_set_freq_scale(const struct cpumask *cpus, unsigned long cur_freq,
unsigned long max_freq)
{
unsigned long scale;
int i;
+ if (WARN_ON_ONCE(!cur_freq || !max_freq))
+ return;
+
/*
* 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.