Skip to content

Commit e0fba87

Browse files
committed
LoongArch: Fix section mismatch due to acpi_os_ioremap()
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>
1 parent ad68461 commit e0fba87

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ config LOONGARCH
3939
select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION
4040
select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION
4141
select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION
42+
select ARCH_KEEP_MEMBLOCK
4243
select ARCH_MIGHT_HAVE_PC_PARPORT
4344
select ARCH_MIGHT_HAVE_PC_SERIO
4445
select ARCH_SPARSEMEM_ENABLE

arch/loongarch/include/asm/acpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern int acpi_pci_disabled;
1515
extern int acpi_noirq;
1616

1717
#define acpi_os_ioremap acpi_os_ioremap
18-
void __init __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
18+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
1919

2020
static inline void disable_acpi(void)
2121
{

arch/loongarch/kernel/acpi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)
4848
early_memunmap(map, size);
4949
}
5050

51-
void __init __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
51+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
5252
{
5353
if (!memblock_is_memory(phys))
5454
return ioremap(phys, size);

0 commit comments

Comments
 (0)