]>
Commit | Line | Data |
---|---|---|
12b5ade7 GKH |
1 | From 9de9a449482677a75f1edd2049268a7efc40fc96 Mon Sep 17 00:00:00 2001 |
2 | From: Gaku Inami <gaku.inami.xh@renesas.com> | |
3 | Date: Tue, 13 Feb 2018 11:06:40 +0900 | |
4 | Subject: Revert "base: arch_topology: fix section mismatch build warnings" | |
5 | ||
6 | From: Gaku Inami <gaku.inami.xh@renesas.com> | |
7 | ||
8 | commit 9de9a449482677a75f1edd2049268a7efc40fc96 upstream. | |
9 | ||
10 | This reverts commit 452562abb5b7 ("base: arch_topology: fix section | |
11 | mismatch build warnings"). It causes the notifier call hangs in some | |
12 | use-cases. | |
13 | ||
14 | In some cases with using maxcpus, some of cpus are booted first and | |
15 | then the remaining cpus are booted. As an example, some users who want | |
16 | to realize fast boot up often use the following procedure. | |
17 | ||
18 | 1) Define all CPUs on device tree (CA57x4 + CA53x4) | |
19 | 2) Add "maxcpus=4" in bootargs | |
20 | 3) Kernel boot up with CA57x4 | |
21 | 4) After kernel boot up, CA53x4 is booted from user | |
22 | ||
23 | When kernel init was finished, CPUFREQ_POLICY_NOTIFIER was not still | |
24 | unregisterd. This means that "__init init_cpu_capacity_callback()" | |
25 | will be called after kernel init sequence. To avoid this problem, | |
26 | it needs to remove __init{,data} annotations by reverting this commit. | |
27 | ||
28 | Also, this commit was needed to fix kernel compile issue below. | |
29 | However, this issue was also fixed by another patch: commit 82d8ba717ccb | |
30 | ("arch_topology: Fix section miss match warning due to | |
31 | free_raw_capacity()") in v4.15 as well. | |
32 | Whereas commit 452562abb5b7 added all the missing __init annotations, | |
33 | commit 82d8ba717ccb removed it from free_raw_capacity(). | |
34 | ||
35 | WARNING: vmlinux.o(.text+0x548f24): Section mismatch in reference | |
36 | from the function init_cpu_capacity_callback() to the variable | |
37 | .init.text:$x | |
38 | The function init_cpu_capacity_callback() references | |
39 | the variable __init $x. | |
40 | This is often because init_cpu_capacity_callback lacks a __init | |
41 | annotation or the annotation of $x is wrong. | |
42 | ||
43 | Fixes: 82d8ba717ccb ("arch_topology: Fix section miss match warning due to free_raw_capacity()") | |
44 | Cc: stable <stable@vger.kernel.org> | |
45 | Signed-off-by: Gaku Inami <gaku.inami.xh@renesas.com> | |
46 | Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com> | |
47 | Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com> | |
48 | Acked-by: Sudeep Holla <sudeep.holla@arm.com> | |
49 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
50 | ||
51 | --- | |
52 | drivers/base/arch_topology.c | 12 ++++++------ | |
53 | 1 file changed, 6 insertions(+), 6 deletions(-) | |
54 | ||
55 | --- a/drivers/base/arch_topology.c | |
56 | +++ b/drivers/base/arch_topology.c | |
57 | @@ -166,11 +166,11 @@ bool __init topology_parse_cpu_capacity( | |
58 | } | |
59 | ||
60 | #ifdef CONFIG_CPU_FREQ | |
61 | -static cpumask_var_t cpus_to_visit __initdata; | |
62 | -static void __init parsing_done_workfn(struct work_struct *work); | |
63 | -static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn); | |
64 | +static cpumask_var_t cpus_to_visit; | |
65 | +static void parsing_done_workfn(struct work_struct *work); | |
66 | +static DECLARE_WORK(parsing_done_work, parsing_done_workfn); | |
67 | ||
68 | -static int __init | |
69 | +static int | |
70 | init_cpu_capacity_callback(struct notifier_block *nb, | |
71 | unsigned long val, | |
72 | void *data) | |
73 | @@ -206,7 +206,7 @@ init_cpu_capacity_callback(struct notifi | |
74 | return 0; | |
75 | } | |
76 | ||
77 | -static struct notifier_block init_cpu_capacity_notifier __initdata = { | |
78 | +static struct notifier_block init_cpu_capacity_notifier = { | |
79 | .notifier_call = init_cpu_capacity_callback, | |
80 | }; | |
81 | ||
82 | @@ -232,7 +232,7 @@ static int __init register_cpufreq_notif | |
83 | } | |
84 | core_initcall(register_cpufreq_notifier); | |
85 | ||
86 | -static void __init parsing_done_workfn(struct work_struct *work) | |
87 | +static void parsing_done_workfn(struct work_struct *work) | |
88 | { | |
89 | cpufreq_unregister_notifier(&init_cpu_capacity_notifier, | |
90 | CPUFREQ_POLICY_NOTIFIER); |