Skip to content

Commit 0d294c8

Browse files
Saurabh SengarIngo Molnar
authored andcommitted
x86/of: Move the x86_flattree_get_config() call out of x86_dtb_init()
Fetching the device tree configuration before initmem_init() is necessary to allow the parsing of NUMA node information. However moving the entire x86_dtb_init() call before initmem_init() is not correct as APIC/IO-APIC enumeration has to be after initmem_init(). Thus, move the x86_flattree_get_config() call out of x86_dtb_init(), into setup_arch(), to call it before initmem_init(), and leave the ACPI/IOAPIC registration sequence as-is. [ mingo: Updated the changelog for clarity. ] Signed-off-by: Saurabh Sengar <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Cc: Sebastian Andrzej Siewior <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2477570 commit 0d294c8

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

arch/x86/include/asm/prom.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ static inline void x86_dtb_init(void) { }
3131
#define of_ioapic 0
3232
#endif
3333

34+
#ifdef CONFIG_OF_EARLY_FLATTREE
35+
void x86_flattree_get_config(void);
36+
#else
37+
static inline void x86_flattree_get_config(void) { }
38+
#endif
3439
extern char cmd_line[COMMAND_LINE_SIZE];
3540

3641
#endif /* __ASSEMBLY__ */

arch/x86/kernel/devicetree.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ static void __init dtb_apic_setup(void)
278278
}
279279

280280
#ifdef CONFIG_OF_EARLY_FLATTREE
281-
static void __init x86_flattree_get_config(void)
281+
void __init x86_flattree_get_config(void)
282282
{
283283
u32 size, map_len;
284284
void *dt;
@@ -300,14 +300,10 @@ static void __init x86_flattree_get_config(void)
300300
unflatten_and_copy_device_tree();
301301
early_memunmap(dt, map_len);
302302
}
303-
#else
304-
static inline void x86_flattree_get_config(void) { }
305303
#endif
306304

307305
void __init x86_dtb_init(void)
308306
{
309-
x86_flattree_get_config();
310-
311307
if (!of_have_populated_dt())
312308
return;
313309

arch/x86/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,8 @@ void __init setup_arch(char **cmdline_p)
12211221

12221222
early_acpi_boot_init();
12231223

1224+
x86_flattree_get_config();
1225+
12241226
initmem_init();
12251227
dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);
12261228

0 commit comments

Comments
 (0)