]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by default
authorSaurabh Sengar <ssengar@linux.microsoft.com>
Tue, 2 Apr 2024 14:40:28 +0000 (07:40 -0700)
committerIngo Molnar <mingo@kernel.org>
Wed, 3 Apr 2024 06:46:08 +0000 (08:46 +0200)
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 <ssengar@linux.microsoft.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/1712068830-4513-3-git-send-email-ssengar@linux.microsoft.com
arch/x86/hyperv/hv_vtl.c
arch/x86/include/asm/prom.h
arch/x86/kernel/devicetree.c
arch/x86/platform/ce4100/ce4100.c

index 3efd0e03b91651f70fb1e6f63ab3c5953bdaf99e..04775346369c59882d82fafb1b64c7804b3517cd 100644 (file)
@@ -34,7 +34,6 @@ void __init hv_vtl_init_platform(void)
        /* Avoid searching for BIOS MP tables */
        x86_init.mpparse.find_mptable = x86_init_noop;
        x86_init.mpparse.early_parse_smp_cfg = x86_init_noop;
-       x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
 
        x86_platform.get_wallclock = get_rtc_noop;
        x86_platform.set_wallclock = set_rtc_noop;
index 043758a2e627037f544022197d41b8a762e6e973..02644e0105141658034ac3b87ed81d4627d61e88 100644 (file)
@@ -24,18 +24,15 @@ extern u64 initial_dtb;
 extern void add_dtb(u64 data);
 void x86_of_pci_init(void);
 void x86_dtb_parse_smp_config(void);
+void x86_flattree_get_config(void);
 #else
 static inline void add_dtb(u64 data) { }
 static inline void x86_of_pci_init(void) { }
 static inline void x86_dtb_parse_smp_config(void) { }
+static inline void x86_flattree_get_config(void) { }
 #define of_ioapic 0
 #endif
 
-#ifdef CONFIG_OF_EARLY_FLATTREE
-void x86_flattree_get_config(void);
-#else
-static inline void x86_flattree_get_config(void) { }
-#endif
 extern char cmd_line[COMMAND_LINE_SIZE];
 
 #endif /* __ASSEMBLY__ */
index 003e0298f46a47b21adad15eb927ff755ad88416..0d3a50e8395ddc9a1d043224adcb1f39d0f4550b 100644 (file)
@@ -277,9 +277,9 @@ static void __init dtb_apic_setup(void)
        dtb_ioapic_setup();
 }
 
-#ifdef CONFIG_OF_EARLY_FLATTREE
 void __init x86_flattree_get_config(void)
 {
+#ifdef CONFIG_OF_EARLY_FLATTREE
        u32 size, map_len;
        void *dt;
 
@@ -301,8 +301,10 @@ void __init x86_flattree_get_config(void)
 
        if (initial_dtb)
                early_memunmap(dt, map_len);
-}
 #endif
+       if (of_have_populated_dt())
+               x86_init.mpparse.parse_smp_cfg = x86_dtb_parse_smp_config;
+}
 
 void __init x86_dtb_parse_smp_config(void)
 {
index f32451bdcfdd5b2f28cd2cbb00eca4984b698f69..f8126821a94d76239d3154aeebb7119978e96dd2 100644 (file)
@@ -139,7 +139,6 @@ void __init x86_ce4100_early_setup(void)
        x86_init.resources.probe_roms           = x86_init_noop;
        x86_init.mpparse.find_mptable           = x86_init_noop;
        x86_init.mpparse.early_parse_smp_cfg    = x86_init_noop;
-       x86_init.mpparse.parse_smp_cfg          = x86_dtb_parse_smp_config;
        x86_init.pci.init                       = ce4100_pci_init;
        x86_init.pci.init_irq                   = sdv_pci_init;