Skip to content

Commit 02a6eaa

Browse files
chenhuacaigregkh
authored andcommitted
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>
1 parent 9d6cc0e commit 02a6eaa

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

arch/mips/kernel/time.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,8 @@ static unsigned long glb_lpj_ref_freq;
4040
static int cpufreq_callback(struct notifier_block *nb,
4141
unsigned long val, void *data)
4242
{
43-
struct cpufreq_freqs *freq = data;
44-
struct cpumask *cpus = freq->policy->cpus;
45-
unsigned long lpj;
4643
int cpu;
44+
struct cpufreq_freqs *freq = data;
4745

4846
/*
4947
* Skip lpj numbers adjustment if the CPU-freq transition is safe for
@@ -64,6 +62,7 @@ static int cpufreq_callback(struct notifier_block *nb,
6462
}
6563
}
6664

65+
cpu = freq->cpu;
6766
/*
6867
* Adjust global lpj variable and per-CPU udelay_val number in
6968
* accordance with the new CPU frequency.
@@ -74,12 +73,8 @@ static int cpufreq_callback(struct notifier_block *nb,
7473
glb_lpj_ref_freq,
7574
freq->new);
7675

77-
for_each_cpu(cpu, cpus) {
78-
lpj = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
79-
per_cpu(pcp_lpj_ref_freq, cpu),
80-
freq->new);
81-
cpu_data[cpu].udelay_val = (unsigned int)lpj;
82-
}
76+
cpu_data[cpu].udelay_val = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
77+
per_cpu(pcp_lpj_ref_freq, cpu), freq->new);
8378
}
8479

8580
return NOTIFY_OK;

0 commit comments

Comments
 (0)