Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2365571pxp; Fri, 18 Mar 2022 09:04:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4dsSR/3TiRfvq6LJnurG0VZo/b78Q4gh/QiBpJQUhsq42H7oa4sCeWQz9/REjph+mONa+ X-Received: by 2002:a17:90b:1bc4:b0:1bf:824:80d8 with SMTP id oa4-20020a17090b1bc400b001bf082480d8mr11763987pjb.3.1647619483690; Fri, 18 Mar 2022 09:04:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647619483; cv=none; d=google.com; s=arc-20160816; b=U//6kQl558l6HQwIBSBwrBNG/q48xrvMuV96MiAG57nWdtVMtiV37vki7zIBzfAXuv tdp4OpUyGuEu70KWMW8/Nm/CjHCQO2S6xp3KI4jLa75rp5Zdx3WswO/3Rt0dT6LOpib3 U3pGVqGss8twFDCPlOwqW5+mMVOXAAbEQx0mu4stEWLed4aohiV1fOXT8mQhcdaw12Hr wcQyeOOoVp1eNuGe/zzKgq1vABixS4PBxSdfFcx1+7Ex8R0xUlARyrUNiuvE18XHg5rx db427/hIRGXDkZVQkgMpHs7oZxg/xQgjvYD5oUAvUcU1c4lyOqDjnMW9IU5348MV/uhF xmbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=s5a9h4tsSyJVPgesmfovxvC58dxyna172J+U8gDcN8U=; b=PyynGc0hEzuY4uBw+BbJf1Tw9LwbPl8VYMFoC8iCh/x6aBrBzj2/nGc5X7ROYEesb4 qpn4kfTPgS7cB4Zme/MkhGDc0xxcPxdSTkXP+pso0wldELveDxOvu1xur1YTHmsibPqf EyoZh8AyXlYrPcP0ZJ1SK3aC2HKIBP70RStVbETfCYgkIb8ZO+3KCzDFPicC6YLy8d10 VltMprbd53PIojHoHepB6d+VY3eLB9foveeceyGSKAXw1ja/3sZseDXwexgmQZZrUkJe I1ghC6Y+vPdoUOWAvlCF53DGX+c4uIzOMWPRSHG3ydQhzlfzUoKA7/DLf2vtCZRtMmUE N4bA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k1-20020a170902760100b00153b2d165b4si2406387pll.444.2022.03.18.09.04.30; Fri, 18 Mar 2022 09:04:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237435AbiCRPGv (ORCPT + 99 others); Fri, 18 Mar 2022 11:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237713AbiCRPGo (ORCPT ); Fri, 18 Mar 2022 11:06:44 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E48DFE0E1; Fri, 18 Mar 2022 08:05:23 -0700 (PDT) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxqsywnzRicaQLAA--.9144S5; Fri, 18 Mar 2022 23:05:22 +0800 (CST) From: Tiezhu Yang To: Thomas Bogendoerfer Cc: Xuefeng Li , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] MIPS: Use memblock_add_node() in early_parse_mem() under CONFIG_NUMA Date: Fri, 18 Mar 2022 23:05:20 +0800 Message-Id: <1647615920-23103-4-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1647615920-23103-1-git-send-email-yangtiezhu@loongson.cn> References: <1647615920-23103-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9AxqsywnzRicaQLAA--.9144S5 X-Coremail-Antispam: 1UD129KBjvdXoWrtFyDGw4DGw1kAw1kKw4kWFg_yoWDWFb_tw 1S9rWkW34ayF1Fvr47X3s3Wa4jy3yUXFyxuFn3ur42ywn8JFyUG393A3WDZrs8uw1DAr95 ZrsxCry5Can7WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbSxFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUWwA2048vs2IY02 0Ec7CjxVAFwI0_Gr0_Xr1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq3wAS0I0E 0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67 AKxVWUJVWUGwAv7VC2z280aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48I cxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCY02Avz4vE14v_XrWl42xK82IYc2 Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s02 6x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0x vE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE 42xK8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6x kF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjTRKD73DUUUU X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Use memblock_add_node to add new memblock region within a NUMA node in early_parse_mem() under CONFIG_NUMA, otherwise the mem parameter can not work well. Signed-off-by: Tiezhu Yang --- arch/mips/kernel/setup.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index c8c8f60..50cdc08 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -378,7 +379,10 @@ static int __init early_parse_mem(char *p) memblock_end_of_DRAM() - memblock_start_of_DRAM()); } - memblock_add(start, size); + if (IS_ENABLED(CONFIG_NUMA)) + memblock_add_node(start, size, pa_to_nid(start), MEMBLOCK_NONE); + else + memblock_add(start, size); return 0; } -- 2.1.0