From 87b06f9ab9b96677f4470b85c2337800fbc8d2c4 Mon Sep 17 00:00:00 2001 From: Sultan Alsawaf Date: Wed, 26 Jan 2022 11:41:13 +0800 Subject: [PATCH] cpufreq: Force the LITTLE cluster to only use the default governor Since the LITTLE cluster now only has two frequencies, both of which are very close to one another, it doesn't make much sense to keep schedutil running for it when there's almost no power difference between the two frequencies. As such, force the LITTLE cluster to stick to the default CPU governor, which is always sanely set to performance. Signed-off-by: Sultan Alsawaf Signed-off-by: v4lkyr Signed-off-by: Tashfin Shakeer Rhythm --- drivers/cpufreq/cpufreq.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index b93c99cda036f..dc0f58d6284df 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -780,6 +780,13 @@ static ssize_t store_scaling_governor(struct cpufreq_policy *policy, char str_governor[16]; struct cpufreq_policy new_policy; + /* + * Force the LITTLE CPU cluster to use the default govenor (performance) + * because keeping it at its maximum frequency is best. + */ + if (cpumask_test_cpu(policy->cpu, cpu_lp_mask)) + return count; + memcpy(&new_policy, policy, sizeof(*policy)); ret = sscanf(buf, "%15s", str_governor);