mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Saurabh Sengar" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Saurabh Sengar <ssengar@linux.microsoft.com>,
	Ingo Molnar <mingo@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/platform] x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by default
Date: Wed, 03 Apr 2024 06:59:52 -0000	[thread overview]
Message-ID: <171212759207.10875.3015707260030588957.tip-bot2@tip-bot2> (raw)
In-Reply-To: <1712068830-4513-3-git-send-email-ssengar@linux.microsoft.com>

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     222408cde4d0ab17e54d4db26751c2b5cab9ac2b
Gitweb:        https://git.kernel.org/tip/222408cde4d0ab17e54d4db26751c2b5cab9ac2b
Author:        Saurabh Sengar <ssengar@linux.microsoft.com>
AuthorDate:    Tue, 02 Apr 2024 07:40:28 -07:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 03 Apr 2024 08:46:08 +02:00

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 <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          | 1 -
 arch/x86/include/asm/prom.h       | 7 ++-----
 arch/x86/kernel/devicetree.c      | 6 ++++--
 arch/x86/platform/ce4100/ce4100.c | 1 -
 4 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/arch/x86/hyperv/hv_vtl.c b/arch/x86/hyperv/hv_vtl.c
index 3efd0e0..0477534 100644
--- a/arch/x86/hyperv/hv_vtl.c
+++ b/arch/x86/hyperv/hv_vtl.c
@@ -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;
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
index 043758a..02644e0 100644
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -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__ */
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 003e029..0d3a50e 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -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)
 {
diff --git a/arch/x86/platform/ce4100/ce4100.c b/arch/x86/platform/ce4100/ce4100.c
index f32451b..f812682 100644
--- a/arch/x86/platform/ce4100/ce4100.c
+++ b/arch/x86/platform/ce4100/ce4100.c
@@ -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;
 

  reply	other threads:[~2024-04-03  6:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 14:40 [PATCH v2 0/4] Fixing SMP config for DeviceTree platforms Saurabh Sengar
2024-04-02 14:40 ` [PATCH v2 1/4] x86/hyperv/vtl: Correct parse_smp_cfg assignment Saurabh Sengar
2024-04-03  6:59   ` [tip: x86/platform] x86/hyperv/vtl: Correct x86_init.mpparse.parse_smp_cfg assignment tip-bot2 for Saurabh Sengar
2024-04-04 23:58   ` [PATCH v2 1/4] x86/hyperv/vtl: Correct parse_smp_cfg assignment Wei Liu
2024-04-02 14:40 ` [PATCH v2 2/4] x86/of: Set the parse_smp_cfg for all the DeviceTree platforms by default Saurabh Sengar
2024-04-03  6:59   ` tip-bot2 for Saurabh Sengar [this message]
2024-04-02 14:40 ` [PATCH v2 3/4] x86/of: Map NUMA node to CPUs as per DeviceTree Saurabh Sengar
2024-04-03  6:59   ` [tip: x86/platform] " tip-bot2 for Saurabh Sengar
2024-04-02 14:40 ` [PATCH v2 4/4] x86/of: Change x86_dtb_parse_smp_config to static Saurabh Sengar
2024-04-03  6:59   ` [tip: x86/platform] x86/of: Change x86_dtb_parse_smp_config() " tip-bot2 for Saurabh Sengar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=171212759207.10875.3015707260030588957.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=ssengar@linux.microsoft.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®