From 7c760522ee066b718cfddc32f3122d6be59b0a03 Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Sat, 11 Jul 2020 12:22:13 +0200 Subject: [PATCH] Revert "mips: Add udelay lpj numbers adjustment", since it causes the build to fail with CONFIG_CPU_FREQ=y. --- debian/changelog | 8 ++ ...ps-Add-udelay-lpj-numbers-adjustment.patch | 102 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 111 insertions(+) create mode 100644 debian/patches/bugfix/mips/Revert-mips-Add-udelay-lpj-numbers-adjustment.patch diff --git a/debian/changelog b/debian/changelog index 319e98bf4..344165b22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +linux (4.19.131-2) UNRELEASED; urgency=medium + + [ Aurelien Jarno ] + * Revert "mips: Add udelay lpj numbers adjustment", since it causes the + build to fail with CONFIG_CPU_FREQ=y. + + -- Aurelien Jarno Sat, 11 Jul 2020 12:19:13 +0200 + linux (4.19.131-1) buster; urgency=medium * New upstream stable update: diff --git a/debian/patches/bugfix/mips/Revert-mips-Add-udelay-lpj-numbers-adjustment.patch b/debian/patches/bugfix/mips/Revert-mips-Add-udelay-lpj-numbers-adjustment.patch new file mode 100644 index 000000000..c4dd705de --- /dev/null +++ b/debian/patches/bugfix/mips/Revert-mips-Add-udelay-lpj-numbers-adjustment.patch @@ -0,0 +1,102 @@ +From: Aurelien Jarno +Date: Sat, 11 Jul 2020 12:16:51 +0200 +Subject: Revert "mips: Add udelay lpj numbers adjustment" +Forwarded: no + +This reverts commit 240934c2d4646fc4ba4423014f6f42ca864acecd. +It does not even build with CONFIG_CPU_FREQ=y as the 'policy' +member has been added in kernel 5.2. +--- + arch/mips/kernel/time.c | 70 ----------------------------------------- + 1 file changed, 70 deletions(-) + +diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c +index 1e631a484ddf..bfe02ded25d1 100644 +--- a/arch/mips/kernel/time.c ++++ b/arch/mips/kernel/time.c +@@ -22,82 +22,12 @@ + #include + #include + #include +-#include +-#include + + #include + #include + #include + #include + +-#ifdef CONFIG_CPU_FREQ +- +-static DEFINE_PER_CPU(unsigned long, pcp_lpj_ref); +-static DEFINE_PER_CPU(unsigned long, pcp_lpj_ref_freq); +-static unsigned long glb_lpj_ref; +-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; +- +- /* +- * Skip lpj numbers adjustment if the CPU-freq transition is safe for +- * the loops delay. (Is this possible?) +- */ +- if (freq->flags & CPUFREQ_CONST_LOOPS) +- return NOTIFY_OK; +- +- /* Save the initial values of the lpjes for future scaling. */ +- if (!glb_lpj_ref) { +- glb_lpj_ref = boot_cpu_data.udelay_val; +- glb_lpj_ref_freq = freq->old; +- +- for_each_online_cpu(cpu) { +- per_cpu(pcp_lpj_ref, cpu) = +- cpu_data[cpu].udelay_val; +- per_cpu(pcp_lpj_ref_freq, cpu) = freq->old; +- } +- } +- +- /* +- * Adjust global lpj variable and per-CPU udelay_val number in +- * accordance with the new CPU frequency. +- */ +- if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || +- (val == CPUFREQ_POSTCHANGE && freq->old > freq->new)) { +- loops_per_jiffy = cpufreq_scale(glb_lpj_ref, +- 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; +- } +- } +- +- return NOTIFY_OK; +-} +- +-static struct notifier_block cpufreq_notifier = { +- .notifier_call = cpufreq_callback, +-}; +- +-static int __init register_cpufreq_notifier(void) +-{ +- return cpufreq_register_notifier(&cpufreq_notifier, +- CPUFREQ_TRANSITION_NOTIFIER); +-} +-core_initcall(register_cpufreq_notifier); +- +-#endif /* CONFIG_CPU_FREQ */ +- + /* + * forward reference + */ +-- +2.27.0 + diff --git a/debian/patches/series b/debian/patches/series index 509f4ea48..4137f29d9 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -79,6 +79,7 @@ bugfix/powerpc/powerpc-fix-mcpu-options-for-spe-only-compiler.patch bugfix/arm/ARM-dts-sun8i-h3-add-sy8106a-to-orange-pi-plus.patch bugfix/arm64/arm64-dts-allwinner-a64-Enable-A64-timer-workaround.patch bugfix/mips/MIPS-Loongson-Introduce-and-use-loongson_llsc_mb.patch +bugfix/mips/Revert-mips-Add-udelay-lpj-numbers-adjustment.patch # Arch features features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch