]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.33/revert-base-arch_topology-fix-section-mismatch-build-warnings.patch
4.14-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.14.33 / revert-base-arch_topology-fix-section-mismatch-build-warnings.patch
CommitLineData
12b5ade7
GKH
1From 9de9a449482677a75f1edd2049268a7efc40fc96 Mon Sep 17 00:00:00 2001
2From: Gaku Inami <gaku.inami.xh@renesas.com>
3Date: Tue, 13 Feb 2018 11:06:40 +0900
4Subject: Revert "base: arch_topology: fix section mismatch build warnings"
5
6From: Gaku Inami <gaku.inami.xh@renesas.com>
7
8commit 9de9a449482677a75f1edd2049268a7efc40fc96 upstream.
9
10This reverts commit 452562abb5b7 ("base: arch_topology: fix section
11mismatch build warnings"). It causes the notifier call hangs in some
12use-cases.
13
14In some cases with using maxcpus, some of cpus are booted first and
15then the remaining cpus are booted. As an example, some users who want
16to 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
23When kernel init was finished, CPUFREQ_POLICY_NOTIFIER was not still
24unregisterd. This means that "__init init_cpu_capacity_callback()"
25will be called after kernel init sequence. To avoid this problem,
26it needs to remove __init{,data} annotations by reverting this commit.
27
28Also, this commit was needed to fix kernel compile issue below.
29However, this issue was also fixed by another patch: commit 82d8ba717ccb
30("arch_topology: Fix section miss match warning due to
31free_raw_capacity()") in v4.15 as well.
32Whereas commit 452562abb5b7 added all the missing __init annotations,
33commit 82d8ba717ccb removed it from free_raw_capacity().
34
35WARNING: vmlinux.o(.text+0x548f24): Section mismatch in reference
36from the function init_cpu_capacity_callback() to the variable
37.init.text:$x
38The function init_cpu_capacity_callback() references
39the variable __init $x.
40This is often because init_cpu_capacity_callback lacks a __init
41annotation or the annotation of $x is wrong.
42
43Fixes: 82d8ba717ccb ("arch_topology: Fix section miss match warning due to free_raw_capacity()")
44Cc: stable <stable@vger.kernel.org>
45Signed-off-by: Gaku Inami <gaku.inami.xh@renesas.com>
46Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
47Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
48Acked-by: Sudeep Holla <sudeep.holla@arm.com>
49Signed-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);