]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.14.130/xtensa-fix-section-mismatch-between-memblock_reserve.patch
Linux 4.19.56
[thirdparty/kernel/stable-queue.git] / releases / 4.14.130 / xtensa-fix-section-mismatch-between-memblock_reserve.patch
1 From 76ce94052c9f42e3f0c5c0651cfb16ad04fa8d1e Mon Sep 17 00:00:00 2001
2 From: Guenter Roeck <linux@roeck-us.net>
3 Date: Thu, 30 May 2019 05:41:38 -0700
4 Subject: xtensa: Fix section mismatch between memblock_reserve and mem_reserve
5
6 [ Upstream commit adefd051a6707a6ca0ebad278d3c1c05c960fc3b ]
7
8 Since commit 9012d011660ea5cf2 ("compiler: allow all arches to enable
9 CONFIG_OPTIMIZE_INLINING"), xtensa:tinyconfig fails to build with section
10 mismatch errors.
11
12 WARNING: vmlinux.o(.text.unlikely+0x68): Section mismatch in reference
13 from the function ___pa()
14 to the function .meminit.text:memblock_reserve()
15 WARNING: vmlinux.o(.text.unlikely+0x74): Section mismatch in reference
16 from the function mem_reserve()
17 to the function .meminit.text:memblock_reserve()
18 FATAL: modpost: Section mismatches detected.
19
20 This was not seen prior to the above mentioned commit because mem_reserve()
21 was always inlined.
22
23 Mark mem_reserve(() as __init_memblock to have it reside in the same
24 section as memblock_reserve().
25
26 Signed-off-by: Guenter Roeck <linux@roeck-us.net>
27 Message-Id: <1559220098-9955-1-git-send-email-linux@roeck-us.net>
28 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
29 Signed-off-by: Sasha Levin <sashal@kernel.org>
30 ---
31 arch/xtensa/kernel/setup.c | 3 ++-
32 1 file changed, 2 insertions(+), 1 deletion(-)
33
34 diff --git a/arch/xtensa/kernel/setup.c b/arch/xtensa/kernel/setup.c
35 index 08175df7a69e..66eefe1919a4 100644
36 --- a/arch/xtensa/kernel/setup.c
37 +++ b/arch/xtensa/kernel/setup.c
38 @@ -310,7 +310,8 @@ extern char _SecondaryResetVector_text_start;
39 extern char _SecondaryResetVector_text_end;
40 #endif
41
42 -static inline int mem_reserve(unsigned long start, unsigned long end)
43 +static inline int __init_memblock mem_reserve(unsigned long start,
44 + unsigned long end)
45 {
46 return memblock_reserve(start, end - start);
47 }
48 --
49 2.20.1
50