Skip to content

Commit 222408c

Browse files
Saurabh SengarIngo Molnar
authored andcommitted
x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by default
x86_dtb_parse_smp_config() must be set by DeviceTree platform for parsing SMP configuration. Set the parse_smp_cfg pointer to x86_dtb_parse_smp_config() by default so that all the dtb platforms need not to assign it explicitly. Today there are only two platforms using DeviceTree in x86, ce4100 and hv_vtl. Remove the explicit assignment of x86_dtb_parse_smp_config() function from these. Signed-off-by: Saurabh Sengar <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fe5e6b5 commit 222408c

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

arch/x86/hyperv/hv_vtl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ void __init hv_vtl_init_platform(void)
3434
/* Avoid searching for BIOS MP tables */
3535
x86_init.mpparse.find_mptable = x86_init_noop;
3636
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
37-
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
3837

3938
x86_platform.get_wallclock = get_rtc_noop;
4039
x86_platform.set_wallclock = set_rtc_noop;

arch/x86/include/asm/prom.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,15 @@ extern u64 initial_dtb;
2424
extern void add_dtb(u64 data);
2525
void x86_of_pci_init(void);
2626
void x86_dtb_parse_smp_config(void);
27+
void x86_flattree_get_config(void);
2728
#else
2829
static inline void add_dtb(u64 data) { }
2930
static inline void x86_of_pci_init(void) { }
3031
static inline void x86_dtb_parse_smp_config(void) { }
32+
static inline void x86_flattree_get_config(void) { }
3133
#define of_ioapic 0
3234
#endif
3335

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
3936
extern char cmd_line[COMMAND_LINE_SIZE];
4037

4138
#endif /* __ASSEMBLY__ */

arch/x86/kernel/devicetree.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ static void __init dtb_apic_setup(void)
277277
dtb_ioapic_setup();
278278
}
279279

280-
#ifdef CONFIG_OF_EARLY_FLATTREE
281280
void __init x86_flattree_get_config(void)
282281
{
282+
#ifdef CONFIG_OF_EARLY_FLATTREE
283283
u32 size, map_len;
284284
void *dt;
285285

@@ -301,8 +301,10 @@ void __init x86_flattree_get_config(void)
301301

302302
if (initial_dtb)
303303
early_memunmap(dt, map_len);
304-
}
305304
#endif
305+
if (of_have_populated_dt())
306+
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
307+
}
306308

307309
void __init x86_dtb_parse_smp_config(void)
308310
{

arch/x86/platform/ce4100/ce4100.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ void __init x86_ce4100_early_setup(void)
139139
x86_init.resources.probe_roms = x86_init_noop;
140140
x86_init.mpparse.find_mptable = x86_init_noop;
141141
x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
142-
x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
143142
x86_init.pci.init = ce4100_pci_init;
144143
x86_init.pci.init_irq = sdv_pci_init;
145144

0 commit comments

Comments
 (0)