From patchwork Mon Oct 2 19:41:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 147532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1725626vqb; Mon, 2 Oct 2023 15:25:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdy/npIIYyG+QSuX6kWXQVnMLHr3tclxqTw9BBlND47KyvtT5bHA+21GTnJJD81acW+buI X-Received: by 2002:a92:d211:0:b0:351:526a:4bc with SMTP id y17-20020a92d211000000b00351526a04bcmr13904542ily.15.1696285559226; Mon, 02 Oct 2023 15:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696285559; cv=none; d=google.com; s=arc-20160816; b=FRX9tPe9gKP5hJLicIUYXvGhWyYO/ZYnbKaHixg27cY8DSyU2SZ6ieJyr9aQoXmj4g 51vSAwoGGHm9z0YWNzwos9gGxSQtn8qn2oBeFu6lQssDbcQlD6nbDhlN68qZCEhsK9sk TNRlSbu6Ib0c9lNKvLtQt185aCT7h9l5/Ms3fV2b0c9a27NP+eqsFg7MzaARFGPnS1EI 71kvW71/bUfdUUBjovy8B2u4jwMkgl7P3o0oPq3WL5I/foBHWDqGvGuOEqyw1HC3W2tt oKAGAdIR83EyoXxxoVzkgpirF9F5Iiyz7GJh0jEyq1ZPQ2777GwNucf9U+usByaAKFMF D3Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=KqlF5EVuQLFpWE0VicqrDur8NnlddH+WVSgjgHI93gQ=; fh=1t4//4iF2C0eQ2DCwqxljKxGShVNc5p/tg52zFdCVTg=; b=bgT17/v827s5Xp7Vu4io2GwFtZ34nAH89oR6M2Q+mWiOsUJ9pTum3eTEwWAcjsNCyZ mw+9QIVbpZvTMD7qSKUWnuQ4JKFdZQQfR1s8SnvaSBtlpoMmiOwv/2N8tLrQ19qRMJTp 9NIrFghT3+bXoXuYRGlkejHUuZ02VPEAZQ+ze7/QmV5bw2IZ2K4mjA2kUiImINEAOKZP aA3x5Bv6try7cnzW0xxLU4Wgo5WhDAtoAW6SCzE/2gldUhGumaku2bIZW1JNQvQTS/v1 4WSqE1m4DIkIq83OCw2k5+SNFPoNVTK4cSreWRDLFmYFOkETTU0Jsj9set5HhLoG5lDO V6Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=d1lSSuBT; dkim=neutral (no key) header.i=@linutronix.de header.b=8yVNKGn6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id j72-20020a638b4b000000b005775a0544e6si28681735pge.135.2023.10.02.15.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 15:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=d1lSSuBT; dkim=neutral (no key) header.i=@linutronix.de header.b=8yVNKGn6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 36C1980A1849; Mon, 2 Oct 2023 12:41:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238930AbjJBTlL (ORCPT + 18 others); Mon, 2 Oct 2023 15:41:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238751AbjJBTlK (ORCPT ); Mon, 2 Oct 2023 15:41:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1A24B3; Mon, 2 Oct 2023 12:41:05 -0700 (PDT) Date: Mon, 02 Oct 2023 19:41:03 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696275664; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KqlF5EVuQLFpWE0VicqrDur8NnlddH+WVSgjgHI93gQ=; b=d1lSSuBT56yRLNBYTUXGs5riRDUOw4o+gByfhuHKyHRVKdXH9TgWm5LC2aY0Pl/h1zy4wB 6FLhzbn9+VJQ2hyQKqrWVRy6vSSFJyyh0Z92+sQAx0yuAJQln3dOnPWWUSl40KDZJzdmYU Q7wugn2Kwyk0UxllSY169AUzA43v2jJtDNEc873IeUU1RxpjlvZYOt+Yhz4Ig9o9Twv5YT QO2TZDx2lGDAG1zD2iFYBomKr4NloiFTprEePRd6d3O1uPQdbSZ4h2Sq19Nhy2t08bWgFZ +DKihTSMhal84GFhFqshTn562WdzcO37KCPvMbMcW9Khc/oXEu5GuBlYg3qesQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696275664; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KqlF5EVuQLFpWE0VicqrDur8NnlddH+WVSgjgHI93gQ=; b=8yVNKGn6AKcvR1BdzXfoIzQOrkHakU2C0FzQCXD74Z7OAQ1AmrAWH8Ls4KQ2JOEw/sM2uV BOxmNnK8VsWhYbAw== From: "tip-bot2 for Saurabh Sengar" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] x86/of: Move the x86_flattree_get_config() call out of x86_dtb_init() Cc: Saurabh Sengar , Ingo Molnar , Sebastian Andrzej Siewior , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1692949657-16446-1-git-send-email-ssengar@linux.microsoft.com> References: <1692949657-16446-1-git-send-email-ssengar@linux.microsoft.com> MIME-Version: 1.0 Message-ID: <169627566397.3135.7322755812726837535.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 12:41:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778684326427115674 X-GMAIL-MSGID: 1778684326427115674 The following commit has been merged into the x86/platform branch of tip: Commit-ID: 0d294c8c4efa5c0f283a6dfc82dc014a5dbd9308 Gitweb: https://git.kernel.org/tip/0d294c8c4efa5c0f283a6dfc82dc014a5dbd9308 Author: Saurabh Sengar AuthorDate: Fri, 25 Aug 2023 00:47:36 -07:00 Committer: Ingo Molnar CommitterDate: Mon, 02 Oct 2023 21:30:09 +02:00 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 Signed-off-by: Ingo Molnar Cc: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/1692949657-16446-1-git-send-email-ssengar@linux.microsoft.com --- arch/x86/include/asm/prom.h | 5 +++++ arch/x86/kernel/devicetree.c | 6 +----- arch/x86/kernel/setup.c | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h index b716d29..65dee24 100644 --- a/arch/x86/include/asm/prom.h +++ b/arch/x86/include/asm/prom.h @@ -31,6 +31,11 @@ static inline void x86_dtb_init(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 87d38f1..afd0992 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -278,7 +278,7 @@ static void __init dtb_apic_setup(void) } #ifdef CONFIG_OF_EARLY_FLATTREE -static void __init x86_flattree_get_config(void) +void __init x86_flattree_get_config(void) { u32 size, map_len; void *dt; @@ -300,14 +300,10 @@ static void __init x86_flattree_get_config(void) unflatten_and_copy_device_tree(); early_memunmap(dt, map_len); } -#else -static inline void x86_flattree_get_config(void) { } #endif void __init x86_dtb_init(void) { - x86_flattree_get_config(); - if (!of_have_populated_dt()) return; diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index b9145a6..ef73704 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -1221,6 +1221,8 @@ void __init setup_arch(char **cmdline_p) early_acpi_boot_init(); + x86_flattree_get_config(); + initmem_init(); dma_contiguous_reserve(max_pfn_mapped << PAGE_SHIFT);