MIPS: Fix build for LTS kernel caused by backporting lpj adjustment
Subsystems (2)
PATCH 1/1 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.
--- arch/mips/kernel/time.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
arch/mips/kernel/time.c +4 -9
@@ -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 ;
Signature · 1 line
2.7.0
Hi, Serge,
Could you please have a look at this patch?
Huacai
Quoted 56 lines · Huacai Chen
Commit
ed26aacfb5f71eecb20a("mips: Add udelay lpj numbers adjustment") has backported to 4.4~5.4, but the "structcpufreq_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 <[email protected]>Cc Stable <[email protected]> # 4.4/4.9/4.14/4.19Signed-off-by Huacai Chen <[email protected]>--- arch/mips/kernel/time.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)arch/mips/kernel/time.c +4
-10@@ -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 ; --2.7.0
Quoted 3 lines · Huacai Chen
Hi, Serge,
Could you please have a look at this patch?
+ Gregkh
This is urgent for next stable release, please take a look.
Thanks
Quoted 59 lines
Huacai
Quoted 55 lines · Huacai Chen
Commit
ed26aacfb5f71eecb20a("mips: Add udelay lpj numbers adjustment") has backported to 4.4~5.4, but the "structcpufreq_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 <[email protected]>Cc Stable <[email protected]> # 4.4/4.9/4.14/4.19Signed-off-by Huacai Chen <[email protected]>--- arch/mips/kernel/time.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)arch/mips/kernel/time.c +4
-10@@ -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 ; --2.7.0
Greg KH
maintainerQuoted 10 lines · Jiaxun Yang
Quoted 3 lines · Huacai Chen
Hi, Serge,
Could you please have a look at this patch?
+ Gregkh
This is urgent for next stable release, please take a look.
Relax, it was only sent 3 days ago, we will get to this...
Also, why was this not caught by any of the testing systems that we have? That might be good to determine so we don't mess up again in the future.
thanks,
greg k-h
Hi, Greg,
Quoted 11 lines · Greg KH
Quoted 9 lines · Jiaxun Yang
Quoted 3 lines · Huacai Chen
Hi, Serge,
Could you please have a look at this patch?
+ Gregkh
Quoted 7 lines
Quoted 1 line
This is urgent for next stable release, please take a look.
Relax, it was only sent 3 days ago, we will get to this...
Also, why was this not caught by any of the testing systems that we have? That might be good to determine so we don't mess up again in the future.
I think that is because CPUFREQ is disabled by default on MIPS.
Huacai
Quoted 4 lines
thanks,
greg k-h
Quoted 13 lines · Huacai Chen
Hi, Greg,
Quoted 10 lines · Greg KH
Quoted 8 lines · Jiaxun Yang
Quoted 3 lines · Huacai Chen
Hi, Serge,
Could you please have a look at this patch?
+ Gregkh
This is urgent for next stable release, please take a look.
Relax, it was only sent 3 days ago, we will get to this...
Ahh, sorry for the rush~
Quoted 5 lines
Quoted 4 lines
Also, why was this not caught by any of the testing systems that we have? That might be good to determine so we don't mess up again in the future.
I think that is because CPUFREQ is disabled by default on MIPS.
Yeah, I'm working with kernel-ci to get more config covered.
Thanks.
- Jiaxun
Quoted 6 lines
Huacai
Quoted 3 lines
thanks,
greg k-h
Hello Huacai,
Thanks for the fix. The patch looks good to me except a small cleanup comment.
Quoted 18 lines · Huacai Chen
Commit
ed26aacfb5f71eecb20a("mips: Add udelay lpj numbers adjustment") has backported to 4.4~5.4, but the "structcpufreq_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 <[email protected]>Cc Stable <[email protected]> # 4.4/4.9/4.14/4.19Signed-off-by Huacai Chen <[email protected]>--- arch/mips/kernel/time.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)arch/mips/kernel/time.c +0
-0
arch/mips/kernel/time.c static unsigned long glb_lpj_ref_freq; · line 44
Quoted 8 lines
arch/mips/kernel/time.c +1
-3@@ -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;
Why do you want to rearrange the cpu and freq variables declarations? IMO the order should be left as before since the change doesn't really make the code looking or working any better. If so the change is unneeded. Moreover reverse xmas tree-like variables declaration looks neater than any other.
After fixing that feel free to add
-Sergey
Quoted 29 lines
arch/mips/kernel/time.c +3
-6/* * 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 ;Signature · 1 line
2.7.0