summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuacai Chen <chenhc@lemote.com>2020-07-16 17:39:29 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-22 09:22:27 +0200
commit02a6eaa973e68b80d9ac16f2a7cefe16595a5407 (patch)
tree4982f100d25eda0b0917b490c8bbfe4cbd4bc9e5
parent9d6cc0e9def4a27178dde54c13ad532910893eb6 (diff)
downloadlinux-stable-02a6eaa973e68b80d9ac16f2a7cefe16595a5407.tar.gz
linux-stable-02a6eaa973e68b80d9ac16f2a7cefe16595a5407.tar.bz2
linux-stable-02a6eaa973e68b80d9ac16f2a7cefe16595a5407.zip
MIPS: Fix build for LTS kernel caused by backporting lpj adjustment
Commit ed26aacfb5f71eecb20a ("mips: Add udelay lpj numbers adjustment") has backported to 4.4~5.4, but the "struct cpufreq_freqs" (and also the cpufreq notifier machanism) of 4.4~4.19 are different from the upstream kernel. These differences cause build errors, and this patch can fix the build. Cc: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Stable <stable@vger.kernel.org> # 4.4/4.9/4.14/4.19 Signed-off-by: Huacai Chen <chenhc@lemote.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/mips/kernel/time.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c
index df18f386d457..79ebf349aab4 100644
--- a/arch/mips/kernel/time.c
+++ b/arch/mips/kernel/time.c
@@ -40,10 +40,8 @@ static unsigned long glb_lpj_ref_freq;
static int cpufreq_callback(struct notifier_block *nb,
unsigned long val, void *data)
{
- struct cpufreq_freqs *freq = data;
- struct cpumask *cpus = freq->policy->cpus;
- unsigned long lpj;
int cpu;
+ struct cpufreq_freqs *freq = data;
/*
* Skip lpj numbers adjustment if the CPU-freq transition is safe for
@@ -64,6 +62,7 @@ static int cpufreq_callback(struct notifier_block *nb,
}
}
+ cpu = freq->cpu;
/*
* Adjust global lpj variable and per-CPU udelay_val number in
* accordance with the new CPU frequency.
@@ -74,12 +73,8 @@ static int cpufreq_callback(struct notifier_block *nb,
glb_lpj_ref_freq,
freq->new);
- for_each_cpu(cpu, cpus) {
- lpj = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
- per_cpu(pcp_lpj_ref_freq, cpu),
- freq->new);
- cpu_data[cpu].udelay_val = (unsigned int)lpj;
- }
+ cpu_data[cpu].udelay_val = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
+ per_cpu(pcp_lpj_ref_freq, cpu), freq->new);
}
return NOTIFY_OK;