]> git.itanic.dy.fi Git - linux-stable/commit
LoongArch: Fix section mismatch due to acpi_os_ioremap()
authorHuacai Chen <chenhuacai@loongson.cn>
Fri, 2 Sep 2022 14:33:42 +0000 (22:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Sep 2022 10:43:49 +0000 (12:43 +0200)
commit6023efd94e5469e7503f69bc1377585db77729a7
tree7f3eb7fe2d1521fd41437649b2121022adb65873
parent0b38a5072464b970319367899e97655389b7bde0
LoongArch: Fix section mismatch due to acpi_os_ioremap()

[ Upstream commit e0fba87c854347007fb9fc873e890b686cc61302 ]

Now acpi_os_ioremap() is marked with __init because it calls memblock_
is_memory() which is also marked with __init in the !ARCH_KEEP_MEMBLOCK
case. However, acpi_os_ioremap() is called by ordinary functions such
as acpi_os_{read, write}_memory() and causes section mismatch warnings:

WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_os_read_memory (section: .text) -> acpi_os_ioremap (section: .init.text)
WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_os_write_memory (section: .text) -> acpi_os_ioremap (section: .init.text)

Fix these warnings by selecting ARCH_KEEP_MEMBLOCK unconditionally and
removing the __init modifier of acpi_os_ioremap(). This can also give a
chance to track "memory" and "reserved" memblocks after early boot.

Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/loongarch/Kconfig
arch/loongarch/include/asm/acpi.h
arch/loongarch/kernel/acpi.c