From patchwork Fri Mar 18 15:05:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiezhu Yang X-Patchwork-Id: 12785418 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 424A6C433FE for ; Fri, 18 Mar 2022 15:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237722AbiCRPGp (ORCPT ); Fri, 18 Mar 2022 11:06:45 -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: 1UD129KBjvdXoWrtFyDGw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o: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-mips@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 Reviewed-by: Jiaxun Yang Tested-by: Jiaxun 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; }